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! I have the lucky task of debugging a C application whose creators have disappeared and left no documentation. When I run the UV3 debugger in simulation mode, I receive an error message : access violation at C:0xFFF0 no execute/read permission This occurs because a subroutine directly calls this area in memory
__API_FLASH_ENTRY_POINT: PUSH AR2 PUSH AR4 PUSH AR6 LCALL 0FFF0h POP AR6 POP AR4 POP AR2 RET
But when I look in the memory map this area is not defined as exec/read. If I reset and then add this area to the memory map manually, and then run, everything works OK. I don't want to have to load this for every run. Why isn't it being loaded into the memory map by the linker? Any idea why they are using address x'FFF0' as the flash entry point? Thanks.
To understand what's happening here, you must do two things:
1) Please read the manual, in particular the datasheet of the chip you're using (but forgot to tell us the name of).
2) Think about the following question: why is that asm function called "__API_FLASH_ENTRY_POINT"? Could that name have some kind of significance?
Why isn't it being loaded into the memory map by the linker?
Because the code at 0xfff0 is neither located by, nor even known to, the linker. The linker has no idea there is any code at that address, or how much code is to be found there.