working with Flashc in uc3c-ek (at32uc3c0512c)

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hey
I try to write big arrey (his size is 250K), I work with the example code but the biggest size that I can write is 4K.
Is it possible to write 250K Bytes to the flashc?
Thank you very much

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How do you know that the biggest size is 4 k (bytes/words) ?
Are you trying to write beyond the end of the flash region ?
Are you trying to write to locked pages ?
Are you using the ASF flashc_memcpy(,,,) to do the writing ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hey. thank you about your answer.
I try to work with the example , and there I tried to define arrey and the biggest size was 4K(bytes).When I tried to define for example, arrey of 8000 bytes , I got errors...
about questions 2 and 3 , I didn't try. I don't know how to do that... I will be happy if you can help me.
about the last question, yes, I am using the flashc_memcpy(...)
Thank you

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Show the array declaration and how you are using flash_memcpy(,,,)


The UC3C0512 has 64 kbytes of SRAM but the compiler uses 4 kbytes for the stack/heap.
This code fragment compiles with no errors.

static unsigned char tttt[60000], *p;
p = (unsigned char *) AVR32_FLASHC_ADDRESS + 100000;
flashc_memcpy( p, &tttt[0], sizeof( tttt ), true );

Last Edited: Thu. Nov 8, 2018 - 05:09 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi

Thank you about your answer.

I work with the example code, the change that I did was declare new size of var8_3 arry.

here my declaration :

 

typedef const struct {
    uint8_t  var8;
    uint16_t var16;
    uint8_t  var8_3[250000];
    uint32_t var32;
} nvram_data_t;

 

How do you know to add 100000 to AVR32_FLASHC_ADDRESS ? how do you know if this address is free?
thank you very much 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My example was intended to indicate that usable RAM is limited (<64 kbytes on that cpu) and that flashc_memcpy(,,) does not care very much where it writes to the flash memory. (it does do some basic checks, such as not writing beyond the 512kbytes of flash that that cpu actually has).

 

You will need to look at the .map file to find where your program ends (and the unused area of FLASH begins).

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ok

thank you very much