I am using the examples from AN4570. The example "EEPROM_ProgramUpto4Bytes". I am writing to location 0x3100 and the data is visible when using the "Memory Monitor" but when the chip is reset the data goes back to 0xFF. I am erasing before writing and the functions are returning success. I am assuming that the BUSCLK is the 4MHz crystal that is clocking the chip (the datasheet is vague about this) so I have set FCLKDIV to 0x03 (3.6 to 4.6MHz). Any ideas on what I'm doing wrong?
解決済! 解決策の投稿を見る。
HI
Before command write sequence, NVM_FCLKDIV should be written to configure the flash clock to be between 0.8 and 1MHz.
be sure you are running the routine from RAM.
Pavel
I also ran this code on myPA4TWR board -
then,I also close the watchdog
when I debug,it also show NO source available for"0x0000(0x0000)()"
I have been trying to run the code in ram but have run into a problem. When I uncomment the lines that copy flash to ram, the debugger fails to launch. I get the error shown in the attached image (EEPROM_ERROR_DEBUG.png).
I am attaching the project that is giving me the issues. The copy lines are in the file hal_eeprom_init.c. Lines 58 and 60.
The chip that I'm running this on is a MC9S08PA4. There is only 512 bytes of ram. The two functions (erase and write) are a total of 204 bytes. I am left with a very small amount of RAM. Could I use the same ram space and copy the functions in as I need them?
Thank you in advance!
I have not been able to try running from ram but I believe that was my issue.
Thank you all!
HI
Before command write sequence, NVM_FCLKDIV should be written to configure the flash clock to be between 0.8 and 1MHz.
be sure you are running the routine from RAM.
Pavel