News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

SMF2000 : Jumping and Executing a different image in eNVM

Started by enliteneer, September 19, 2020, 12:16:13 AM

Previous topic - Next topic

enliteneer

Having issues implementing Application Note AC372 on my M2S010-400VF board (256KB NVM, 64KB Ram).   It seems the application I'm trying to jump either isn't built properly, isn't getting flashed or the jump is not happening.

In Libero 12.3, I've updated the eNVM memory contents with 3 hex files, generate bitstream, and run program action.

See image

The "power-on" image blinks 1 led then jumps to App2.  App1 and 2 blink different leds.      Unfortunately, I only see the power-on blink, and never the execution of the App2 code (located at 0x30000)   

The power-on Jump is the following assembly code:


.equ VECTOR_TABLE_ADDR, 0x00030000
    .align 4
bx_3rd_eNVM_Image:
    ldr r0,=VECTOR_TABLE_ADDR /* Step 1. */
    ldr r1,[r0,#0x0] /* Step 2. */
    movw r2,#0xED08
    movt r2,#0xE000
    str r0, [r2, #0]
    ldr lr,[r0,#0x4] /* Step 3. */
    msr msp,r1 /* Step 4. */
    bx lr /* Step 5. */
  .end



The App2's linker script is:



OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
GROUP(-lc -lgcc -lm)
OUTPUT_ARCH(arm)
ENTRY(Reset_Handler)
SEARCH_DIR(.)
__DYNAMIC = 0;
MEMORY
{
    /* M2S010-1VF400 Pages : 2032+16 Pages * 128 Bytes/Page = 256KB */
 
/* rom (rx) : ORIGIN = 0x00000000 , LENGTH = 64k */   /* ORIGIN = 0x00030000 , LENGTH = 64k */   
   rom (rx) : ORIGIN = 0x00030000, LENGTH = 8192   


   ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64k /* 60K*/
}

RAM_START_ADDRESS = 0x20000000; /* Must be the same value MEMORY region ram ORIGIN above. */
RAM_SIZE = 60k; /* Must be the same value MEMORY region ram LENGTH above. */
MAIN_STACK_SIZE = 4k; /* Cortex main stack size. */
MIN_SIZE_HEAP = 4k; 

PROVIDE (__main_stack_start = RAM_START_ADDRESS + RAM_SIZE);
PROVIDE (__process_stack_start = __main_stack_start - MAIN_STACK_SIZE);
PROVIDE (_estack = __main_stack_start);
PROVIDE (__mirrored_nvm = 0);



Using the debugger, App2 blinks the led, however when I inspect the the flash memory at address 0x30000, I see all 0x00 yet the app2.hex shows non-zero

See image




enliteneer

BTW, if I change the app2's linker script to:

rom (rx) : ORIGIN = 0x00000000 , LENGTH = 8192


Then I at see it the data at 0x30000, but my jump still doesn't generate the app2 blink!