<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code for Bootstrap Loader</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/16688/code-for-bootstrap-loader</link><description> Is there a way to get a copy of the bootstrap loader code that is initially executed by the C16x controller. This code would be very helpful and instructive, as I&amp;#39;m trying to figure out how to load and execute a second application program after my original</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Code for Bootstrap Loader</title><link>https://community.arm.com/thread/71978?ContentTypeID=1</link><pubDate>Tue, 21 Oct 2003 14:33:04 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:542c50e3-cff9-4eec-964d-e65080139b5a</guid><dc:creator>Bruno Coppi</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;
I just took the following code from an old Infineon appnote, no more available on the Internet; I already implemented it into an application, and it behaves exactly as original on chip bootstrap.&lt;br /&gt;
Hope this helps you&lt;br /&gt;
Bruno&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
         DISWDT                   ; disable watchdog timer
         MOV   SP,#0FC00h         ; set stackpointer
         MOV   STKUN,#0FC00h      ; set stack underflow pointer
         MOV   STKOV,#0FA00h + 6  ; set stack overflow  pointer
         MOV   CP,#0FC00h         ; set registerbank
WaitStartBit:
         JB    P3.11,WaitStartBit ; wait for start bit at RXD0
         BSET  T6R                ; start timer T6
WaitStopBit:
         JNB   P3.11,WaitStopBit  ; wait for stop bit at RXD0
         BCLR  T6R                ; stop timer T6
         MOV   MDL,T6             ;
         SUB   MDL,#36            ; rounding &amp;amp; adjustment
         MOV   R1,#72             ; baudrate = (T6 / 72) - 1
         DIVU  R1                 ;
InitSerialPort:
         MOV   S0BG,MDL           ; load baudrate generator
         BSET  P3.10              ; initialize TXD0 output
         BSET  DP3.10             ;
         MOV   S0CON,#8001h       ; initialize serial port 0:
                                  ; 8-bit data, no parity, one stop bit
                                  ; receiver not started: single wire option
SendAcknowledge:
         MOV   S0TBUF,#0C5H       ; send acknowledge byte for baudrate check
WaitTransmOver:
         JNB   S0TIR,WaitTransmOver ; wait till end of transmission
         BCLR  S0TIR              ; clear transmit interrupt request flag
         BSET  S0REN              ; receiver enabled
ReceiveData:
         MOV   R0,#0FA40H         ;
ReceiveLoop:
         JNB   S0RIR,ReceiveLoop  ; wait for receive interrupt request
         MOVB  [R0],S0RBUF        ; store received byte
         BCLR  S0RIR              ; clear receive interrupt request flag
         CMPI1 R0,#0FA5FH         ; all bytes received ?
         JMPR  CC_NE,ReceiveLoop  ; if not, continue loop
         JMPS  0,0FA40H           ; yes: jump to RAM routine

&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Code for Bootstrap Loader</title><link>https://community.arm.com/thread/41091?ContentTypeID=1</link><pubDate>Fri, 10 Oct 2003 07:43:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2e17ba09-b075-4aea-a180-c311718bf230</guid><dc:creator>Walt Conley</dc:creator><description>&lt;p&gt;Have a look at the boot code for the monitor, the file keil\c166\monitor\batch\boot167.a66 for example. This file includes a 32 byte sub-program that the boot strap loader loads then executes. This sub-program continues loading the rest of the code in the file and when that is complete it executes it.&lt;br /&gt;
&lt;br /&gt;
For an example of autobaud rate detection take a look at the file inst167.a66 in the same directory.&lt;br /&gt;
&lt;br /&gt;
-Walt&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Code for Bootstrap Loader</title><link>https://community.arm.com/thread/41085?ContentTypeID=1</link><pubDate>Fri, 10 Oct 2003 06:18:05 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c2ac6f05-0ae3-4668-880b-0bdb6f795edd</guid><dc:creator>Mik Kleshov</dc:creator><description>&lt;p&gt;You would have to contact Infineon and ask them, but I can&amp;#39;t see how that code would be of much use to you. The not-very-trivial part there would be automatic baud rate detection. The rest is easy: load program into memory, jump to its start.&lt;br /&gt;
Probably that&amp;#39;s exactly what you want to do in your program: load the second program into RAM and jump to the entry point. You would have to set up the correct environment for running the second program, most notably interrupt vectors, among other things. But the built-in boot ROM code of C16x will not help you with that. All the info is in the microcontroller manual.&lt;br /&gt;
&lt;br /&gt;
- mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>