We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi friends,
I am a beginner. I typed a program and after translating i get no error. But i get an error as shown below, while building hex file for that program.
The error is
filename.sct(7): error: L6236E: No section matches selector - no section to be FIRST/LAST.
Oh,God! l am also a beginner at ARM programming and I can't compile a simple assembly project getting this error too!But finally l found the solution:
R_IROM1 0x08000000 0x00040000 { ; load region size_region ER_IROM1 0x08000000 0x00040000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) } RW_IRAM1 0x20000000 0x0000A000 { ; RW data .ANY (+RW +ZI) } }
The _FIRST object that the linker wants to put into the image is the area called RESET. You do not have a RESET region in your code. Add something along the lines of
AREA RESET, DATA, READONLY
to your assembly file where you want execution to begin.
Create a project with the startup file and look for the AREA RESET ..... declaration and copy that.
For Cortex it looks like:
AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD MemManage_Handler ; MPU Fault Handler DCD BusFault_Handler ; Bus Fault Handler DCD UsageFault_Handler ; Usage Fault Handler DCD 0
Each of those handlers needs to be declared, but you can just add the stack pointer and reset handler to get started.
Hope it helps as well!