56F84763, firmware update, Bootloader, SDM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

56F84763, firmware update, Bootloader, SDM

1,259 Views
sfe
Contributor II

Hello!

 

Currently I'm working on a field update for our 56F84763 processors.

And right now I have a problem with the flashing of the device.

 

Our project is small, so we work with the SDM.

For the flashing I load the flash routine in the program memory RAM of the device. Which is outside the addressable memory space in SDM.

Sometimes the flashing works, sometimes it does not. I don't know if its the fault of the actual code or some restrictions in the device.

 

My actual question is: do the limitations of the SDM (i.e. 16 memory addresses) only apply for access in data memory? Or does the same apply for program memory?

I'd be happy if someone could point me at the right document. I found lots of bits an pieces, but its hard to get the full picture.

 

Thanks and best regards,

Sebastian

Labels (1)
0 Kudos
Reply
2 Replies

1,106 Views
TICS_Fiona
NXP Employee
NXP Employee

Hello Sebastian,

The compiler default arrangement is using 16-bit addresses for all data accesses. This means that absolute addresses (X:xxxx addressing mode) are limited to 16 bits. Direct addressing or pointer registers load or store 16-bit addresses. Indexed addressing indexes are 16-bit quantities. The compiler treats data pointers as 16-bit pointers that you may store in single words of memory.  This is called  SDM (small data model)

If the large data memory model (LDM) is enabled, the compiler accesses all data by 24-bit addressing modes. It treats data pointers as 24-bit quantities that you may store in two words of memory. Absolute addressing occurs as 24-bit absolute addresses. Thus, you may access the entire 24-bit data memory, locating data objects anywhere.

Best Regards

Fiona Kuang

Technical Information & Commercial Support

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,106 Views
sfe
Contributor II

Hey Fiona,

thanks for the information. It does not really help me, though. This is the part of the SDM/LDM that I did understand. So far I gather that the same does not apply for code. There is for example the JSR assembler command that can use 19Bits for addressing while still only using 16Bits of data. And as it turns out, the secondary ram memory can be used for program code even in SDM mode.

In the last few days I solvced my flash issue. And it turned out, that the problem originated from setting the configuration registers (FTFL_FCCOBn) inside the flash function that ran from RAM. The configuration was passed into the function as a pointer. But somehow when the data was dereferenced the wrong data was accessed and therefore the wrong configuration written. This did not happen when stepping through the code in debugging.

It took me a while to finde, because i relied on the code I got from the AN4860 flash driver library. It finally helped to look at what the Processor expert flash bean did. There the configuration happens outside of the function.

The flashing now works fine. The minimalisting flash function runs in secondary RAM (at 0x62F00) and the project is compiled using SDM.

If anybody runs into similar problems just contact me.

Regards

Sebastian

0 Kudos
Reply