Hi,
I use the R7FA6M4AD3CPF device with FSP 3.4.0.
For my project, I need my application start at address 0x10000.
I duplicate the file 'memory_regions.ld' in 'memory_regions_App.ld' and modifiy the name in the file fsp.ld.
In memory_regions_App.ld, i change the 'FLASH_START' to 0x10000 and 'FLASH_LENGTH' to 0x70000.
I add this 3 rows in the debugger (Run commands) :
set $pc = *0x00010004 set $sp = *0x00010000 set {int}0xE000ED08 = 0x00010000
i don't know why, but it doesn't work.
Note : the application run if i leave the start address at 0.
Thank you for your help.
Another question : How to jump to this application by another application at address 0
In fsp.ld have you changed the include from 'memory_regions.ld' to 'memory_regions_App.ld'?
Ian.
Hi Ian,
Yes.
Have you tried cleaning the project and rebuilding. Sometimes if you make a change to a linker script it doesn't cause the application to be re-linked.
Try looking in the .map file to check that the flash based code is being located to the desired address.
After clean and rebuild, idem, build is OK but when i start to debug, start and do nothing.
The .MAP :
When the code is downloaded to the debugger before any code is run do the PC and SP point to the correct memory locations?
SP is to 0x200033b0
PC is to 0x0001DF9C (Reset Handle)
In what way does it not work?
If you step through the code can you find where it fails and why?
It fails immediatly after start without entry in SystemInit function.
When I stop the debugger I have this (in debug log at left) :
I have delete all file and folder in debug folder and rebuild, but the result is the same.
With the debugger connected click on the icon which is an 'i' with an arrow to the right. This enables instruction (asm) stepping mode. This might help work out what is happening when used with the register view.
It going in error immediatly on the first instruction :
push {r7, lr}
Having dealt with the linker map, I think the problem is that the vector table is included after FLASH_START. By changing FLASH_START, the vector table has been moved so the reset vector isn't pointing in the right place.
Hi dsherman26,
I have create a new program with just blinky a Led.
I have the same problem.
The hardware doesn't know that the vector table isn't where it expects to find it. You'll have to leave FLASH_START at 0x0 to ensure the vector table is where it's supposed to be at reset. If you want your execution to begin somewhere specific, you can specify where Reset_Handler is located, but the reset vector table location doesn't change.
In the debugger startup menu, if I delete the 3 row :
And I set program counter at 0x10E25 :
Then, the program start.
Or if I leave just the first line :
set $pc = *0x00010004
The program also works (the new program with just one led blinky).
With the same modification, my program doesn't work. It stop on the SystemInit function.
Hi Cyp46- Do you still have an issues or were you able to get your program working? let us know.
Hi WarrenM
I haven't advanced on the subject yet