Build RAM only application – does not work outside IDE

Sysprogs forums Forums VisualGDB Build RAM only application – does not work outside IDE

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #26424
    urosg
    Participant

    Hi,

    I tried building a simple Blinky application for Cortex-M3 device (LPC1833) that runs only in RAM; which I was successful in doing so, but it only runs when started from IDE.

    If I load the generated .bin with JLink Commander to RAM address (0x10000000).

     

    loadbin test.bin,0x10000000
    
    SetPC 0x10000000
    
    go
    
    
    

    it doesn’t work.

     

    As far as I know this is the way to load and start the application manually from RAM, but I must be missing something.

     

    Any help will be greatly appreciated.

    #26426
    support
    Keymaster

    Hi,

    It looks like you are setting the $pc to an incorrect value (the address of the interrupt vector table rather than the reset handler). Instead you would need to parse the interrupt vector table and extract the reset handler address from it (see ARM Cortex-M3 documentation for details). Alternatively, please consider programming the ELF file instead. Its header explicitly contains the entry point address and most tools automatically set $pc accordingly when loading ELF files.

    #26646
    urosg
    Participant

    Hi,

     

    thank you for the suggestion, I found the solution:

    • get address of “Reset_Handler” function
    • set $pc to the address
    • go

     

    But now I have a new problem; interrupts are not working with the built “Blinky” example – i.e. SysTick_Handler is newer called.

    Looking at lds everything is in SRAM, also everything else works, but looking through the sources the vector table does not get relocated (VTOR is not explicitly set), is this expected to be done automatically or is it really missing?

     

    #26659
    support
    Keymaster

    Hi,

    Depending on the SDK you are using, the VTOR might indeed not get set explicitly (not all device SDKs support this). Setting it manually from your code (guarded with #ifdef sram_layout) should fully fix the problem through.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.