Show Posts
Pages: [1]
1  Products / Arduino Due / Re: EEFC page programming on: January 28, 2013, 01:22:26 am
I am aware of and have considered those four points. They're all pretty clearly stated in the datasheet.
Thanks, though.


My Due is reporting only one plane of 256kB. Strange.
2  Products / Arduino Due / Re: EEFC page programming on: January 24, 2013, 10:37:12 pm
Ok... so, I've ditched the Arduino IDE and moved back to Atmel Studio 6.
The IDE causes all sorts of issues/conflicts that I can never figure out.

I can now call the IAP function using the exact same code I was trying to use in the Arduino IDE.

I am successfully programming the flash.

I now have two unanswered questions.
  • Why can I not call the IAP function using the Arduino IDE?
  • Why am I getting only one plane of 256kB when I retrieve the flash descriptor?
    (Should I not be getting 2x256kB?)

I was intending on setting the boot flag for flash0/flash1 to jump to/from a bootloader.
3  Products / Arduino Due / Re: EEFC page programming on: January 23, 2013, 11:10:44 pm
I have come to the conclusion that I must use the IAP function stored in the ROM.

How to call this, I am unsure.

The example given in the datasheet passes it two arguments. The EEFC ID (0 or 1) and the contents to write to the EEFC_FCR register.
However, the description of the function specifies it only takes one argument.

In any case, I am unable to call it successfully. The Arduino simply hangs.

Perhaps there is some way to run a function from ram.
4  Products / Arduino Due / EEFC page programming on: January 23, 2013, 10:13:42 pm
I'm trying to write to pages using the EEFC on the SAM3X.

I've successfully managed to write and read lock-bits using code like the following.

Code:
EFC0->EEFC_FCR = (0x5A << 24) | 0x0A;
while (!EEFC_FSR_FRDY) {
}
Serial.print("FRR: ");
Serial.println(EFC0->EEFC_FRR);


If I read the flash descriptor using
Code:
EFC0->EEFC_FCR = (0x5A << 24) | 0x00;
I am informed that there is 1 plane of 256kB of memory. Each page is 256 bytes and there are 16 lock bits covering 16384 bytes (64 pages) each.

Isn't the SAM3X meant to have two planes of 256kB for a total of 512kB?

Nevertheless, using these figures I calculated that 0xBE800 should correspond to the 1000th page (0x3E8).

Code:
pp = (uint32_t*)0xBE800;
*pp++ = 0xFF00FF00;
*pp++ = 0xFF00FF00;
*pp++ = 0xFF00FF00;
*pp++ = 0xFF00FF00;
EFC0->EEFC_FCR = (0x5A << 24) | ( 0x3E8 << 8 ) | 0x03;

The Arduino hangs.
But upon reboot... success! The page of flash was written correctly.
If I try using EEFC1, the Arduino remains responsive but the page is not written.
Pages: [1]