Does anybody have some example routines for reading/writing to high addresses
in
the flash?
This is what I've written so far, but it's far from a working version:
static inline __attribute__((always_inline)) void
flash_write_byte(uint32_t addr, uint8_t val)
{
__asm__ __volatile__ (
"dint \n"
"nop \n"
"mova %[addr], r15 \n"
"movx %[val], @r15 \n"
"eint \n"
:
:[addr] "r"(addr), [val] "m"(val)
);
}
static inline __attribute__((always_inline)) uint8_t
flash_read_byte(uint32_t addr)
{
uint8_t result;
__asm__ __volatile__ (
"dint \n"
"nop \n"
"mova %[addr], r15 \n"
"movx @r15, %[result] \n"
"eint \n"
:[result] "=m"(result)
:[addr] "r"(addr)
);
return result;
}
The problem, from what I could tell, comes from the inlining of the functions
and the way the compiler generates their prologue. It would help me very much
if
I had fully working example to start from.
Alex
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users