This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

  • Resolved

bootloader via uart problems

Prodigy 145 points

Replies: 7

Views: 3438

hello,

I am using lm3s9b92 evalbot robotic kit, i have some problems a bout  bootloader via uart for it.

I using source library on path: C:\StellarisWare\boot_loader and select some codes: (bl_packet.c bl_uart.c bl_flash.c bl_check.c  bl_main.c and bl_startup_rvmdk.S) to creating a project, i using KEIL IDE to compile it.

the first it show some errors on bl_startup_rvmdk.s file:

assembling bl_startup_rvmdk.S...
codes\bl_startup_rvmdk.S(25): error: A1023E: File "bl_config.inc" could not be opened: No such file or directory
codes\bl_startup_rvmdk.S: 25 00000000 include bl_config.inc
codes\bl_startup_rvmdk.S(60): error: A1516E: Bad symbol '_STACK_SIZE', not defined or external
codes\bl_startup_rvmdk.S: 60 00000000 space _STACK_SIZE * 4
codes\bl_startup_rvmdk.S: ^
codes\bl_startup_rvmdk.S(115): error: A1516E: Bad symbol '_APP_START_ADDRESS', not defined or external
codes\bl_startup_rvmdk.S: 115 00000044 if :def:_USB_ENABLE_UPDATE :lor: \037 (_APP_START_ADDRESS != _VTABLE_START_ADDRESS) :lor: \037 :def:_FLASH_PATCH_COMPATIBLE
codes\bl_startup_rvmdk.S: ^
codes\bl_startup_rvmdk.S(151): error: A1516E: Bad symbol '_APP_START_ADDRESS', not defined or external
codes\bl_startup_rvmdk.S: 151 00000044 if :def:_USB_ENABLE_UPDATE :lor: \037 (_APP_START_ADDRESS != _VTABLE_START_ADDRESS)
codes\bl_startup_rvmdk.S: ^
codes\bl_startup_rvmdk.S(390): error: A1516E: Bad symbol '_APP_START_ADDRESS', not defined or external
codes\bl_startup_rvmdk.S: 390 0000000e if (_APP_START_ADDRESS != _VTABLE_START_ADDRESS)
codes\bl_startup_rvmdk.S: ^
codes\bl_startup_rvmdk.S(419): error: A1516E: Bad symbol '_VTABLE_START_ADDRESS', not defined or external
codes\bl_startup_rvmdk.S: 419 00000012 if (_VTABLE_START_ADDRESS > 0xffff)
codes\bl_startup_rvmdk.S: ^
codes\bl_startup_rvmdk.S(429): error: A1516E: Bad symbol '_APP_START_ADDRESS', not defined or external
codes\bl_startup_rvmdk.S: 429 0000001c if (_APP_START_ADDRESS != _VTABLE_START_ADDRESS)
codes\bl_startup_rvmdk.S: ^
codes\bl_startup_rvmdk.S: 7 Errors, 0 Warnings
Target not created

I have already defined again as following:

_APP_START_ADDRESS equ 0x00001000
_STACK_SIZE equ 64
_VTABLE_START_ADDRESS equ 0

It show:

assembling bl_startup_rvmdk.S...
codes\bl_startup_rvmdk.S(25): error: A1023E: File "bl_config.inc" could not be opened: No such file or directory
codes\bl_startup_rvmdk.S: 25 00000000 include bl_config.inc
codes\bl_startup_rvmdk.S: 1 Error, 0 Warnings
Target not created

I am not see bl_config.inc on this path????

when i ignore this file and build it show:

assembling bl_startup_rvmdk.S...
linking...
.\Obj\simple_display.axf: Error: L6915E: Library reports error: __use_no_semihosting_swi was requested, but __user_initial_stackheap was referenced
Target not created

I don't know about these errors and i think our bl_startup_rvmdk.S file has not yet completed.

my project on mediafire: http://www.mediafire.com/?u4u1owthd86xcfl

Please tell me about this.

Thanks

Vui Nguyen 

  • Hi Vui,

    I suggest you start with an existing serial bootloader project, such as C:\StellarisWare\boards\dk-lm3s9b96\boot_serial

    Regards,

    Sue

  • In reply to Sue Cozart:

    hi Sue,

    I have already built boot_serial source code on the path: C:\StellarisWare_more\boards\dk-lm3s9d96\boot_serial for lm3s9b92 chip and programming via ICDI interface first at addr: 0x00 and then i programming via UART interface at addr: 0x1000 with boot_serial.bin file, i using a serial analyzing software to know transfering packet between LM Flash Programmer software and my board. The result which i get when i press "Program" button is:

    software write: {

    0x03, 0x20, 0x20

    }  

    board response: {

    0x03

    }

    and then software have a following notice: 

    I'm try again on a lot of times but It have no change.

    may be chip have no a program. I think it have some problems this source.

    I have already created a private project with startup_rvmdk.S file which KEIL create defaultly, I written more some functions about: receive packet, send packet,.. and more functions to communicate with flash memory. I'm sure these code is testing fine.

    I linked *.sct file:

    LR_IROM 0x00000000 0x00010000
    {
    ;
    ; Specify the Execution Address of the code and the size.
    ;
    ER_IROM 0x00000000 0x00010000
    {
    *.o (RESET, +First)
    * (InRoot$$Sections, +RO)
    }

    ;
    ; Specify the Execution Address of the data area.
    ;
    RW_IRAM 0x20000000 0x00010000
    {
    ;
    ; Uncomment the following line in order to use IntRegister().
    ;
    ;* (vtable, +First)
    * (+RW, +ZI)
    }
    }

    and my target is: IROM1 {start: 0x0, size 0x40000} IRAM1{start: 0x20000000, size: 0x18000}

    I have already used ICDI interface to program first and then I used UART interface program with info {Disable Auto Baud Support, Program Addr offset: 0x1000}

    my final result is:

    software send: {

    03 20 20 0B 6B 21 00 00 10 00 00 00 12 28

    }

    and board send: {

    00 CC 

    }

    but,

    software have a following notice:

    and:

    I know: 

    + software send command to ping (0x20) and my code respone ACK=0x00,0xCC -> ok

    + software send command to download (0x21) with 9bytes -> fail

    my question:

    + if I make continuously UART bootloader with this direction, will it fine??because I see my *.s file defferent with your *.s file. If it possible, please tell me how to fix it.

    + I am very like create a new some things, so please support for me making code on this direction.

    Thanks and BR!

  • In reply to adam adam1:

    Hi Sue,

    I have already passed some commands (cmd= PING,DOWNLOAD,RUN,GET_STATUS,SEND_DATA,RESET) to load a .bin file to board and write in flash memory with new  my project and new my code.

    I have no use your bl_startup_rvmdk.S file, because it so complex for me.

    I have already used addr = 0x0000 -> 0x2000 (8KB) for bootloader code and addr = 0x2000 -> .... for user code

    Now, my final problem is: how to jump to user address to executing my code in flash memory?

  • Guru 26105 points

    In reply to adam adam1:

    Hi,

    The mechanics of jumping to application's start address is explained in the file bl_startup_rvmdk.S, lines 372...439. The execution is done at line 439 with the .asm instruction "bx r0", so you must link this file to your project and make the needed configurations in bl_config.h.

    Petrei

  • In reply to adam adam1:

    Hi,

    I test successfully.

    I have already written more some asembly codes to:

    + load new stack pointer address

    + load new program counter address

    and jump to application address.

    result: after getting data from software successfully, it jump to application address, reset board and run with code in application address.

    I can close this thread here.

    BR,

  • In reply to adam adam1:

    Hi,

    Is there any way to pass uart related commands like PING,SEND,DOWNLOAD using LM flash programmer.

    I programmed serial bootloader at 0x0 location in LM3s9b96 board through LM flash programmer using in circuit debugger, but iam unable to give above mentioned commands.  Do i need any serial protocol based software for giving the above mentioned commands.

    Please help me in this.

    Thanks

    balaji

  • In reply to balaji v1:

    Hello Balaji,

    Please review the Stellaris Boot Loader User's Guide that is found in the docs folder of your StellarisWare download.

    Regards,

    Sue

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.