Hello
I'd like to save a history with error conditions in the internal flash from the PIC32MX795F512L
I use the compiler MikroC Pro for PIC32 V3.3.3
In addition I have also found the following commands:
Flash_Write_Word
Flash_Write_Row
Flash_Erase_Page
This function always need a flash address. How do I select them?
In one example of MIKROE I've found that you write to the address 0x9D001000. How is this reserved that I do not overwrite a variable of the rest of the programm.
I have hear a long time ago something like memory allocate but I have not found some idea how I can reserve a definite space of the flash.
I will not write data every seconde. Only if an error occur.
Thank you for your help
Salvatore
Storage data on flash of PIC32MX795F512L
Storage data on flash of PIC32MX795F512L
- Attachments
-
- FLASH.zip
- Example from MikroE
- (66.64 KiB) Downloaded 161 times
- Aleksandar.Mitrovic
- mikroElektronika team
- Posts: 1697
- Joined: 11 Mar 2015 12:48
Re: Storage data on flash of PIC32MX795F512L
Hi,
I suggest you to take a look at this post how to allocate your flash memory:
http://www.mikroe.com/forum/viewtopic.p ... te#p216185
Also If you want to know which address are used in your microcontroller I suggest you to take a look at .mlk file of that specific microcontroller.
You can open .mlk file in your compiler by pressing Ctrl+Alt+M buttons.
Best regards,
Aleksandar
I suggest you to take a look at this post how to allocate your flash memory:
http://www.mikroe.com/forum/viewtopic.p ... te#p216185
Also If you want to know which address are used in your microcontroller I suggest you to take a look at .mlk file of that specific microcontroller.
You can open .mlk file in your compiler by pressing Ctrl+Alt+M buttons.
Best regards,
Aleksandar
Re: Storage data on flash of PIC32MX795F512L
Thanks you for your help
At the moment I have not the time to show.
I will show as soon as possible and give feedback.
Thanks
At the moment I have not the time to show.
I will show as soon as possible and give feedback.
Thanks
- Aleksandar.Mitrovic
- mikroElektronika team
- Posts: 1697
- Joined: 11 Mar 2015 12:48
Re: Storage data on flash of PIC32MX795F512L
Hi,
I'm expecting your answer.
Best regards,
Aleksadnar
I'm expecting your answer.
Best regards,
Aleksadnar
Re: Storage data on flash of PIC32MX795F512L
Hello
So had time to test your answer
It seems it works with
const long flashvector[512] = {0x00} absolute 0x7D000000;
But if I declarate so it define an array witch contain 0. How I can declarate an array without define the value to a flash address. That I can load every startup the past error's?
Like unsigned int flashvector[length]
If I do write like:
const long flashvector[512] absolute 0x7D000000;
I become the error:
extern can not have absolute flashvector
Pointer required
Invalid statement
Thanks for your help
So had time to test your answer
It seems it works with
const long flashvector[512] = {0x00} absolute 0x7D000000;
But if I declarate so it define an array witch contain 0. How I can declarate an array without define the value to a flash address. That I can load every startup the past error's?
Like unsigned int flashvector[length]
If I do write like:
const long flashvector[512] absolute 0x7D000000;
I become the error:
extern can not have absolute flashvector
Pointer required
Invalid statement
Thanks for your help
- Aleksandar.Mitrovic
- mikroElektronika team
- Posts: 1697
- Joined: 11 Mar 2015 12:48
Re: Storage data on flash of PIC32MX795F512L
Hi,
If you want to use this array to storage some data in, you should declare that array as variable.
In case that you declare your array as constant it will be stored in ROM and you will not be able to change data in this array.
Values of the memory locations should be assigned with some values.
Best regards,
Aleksandar
If you want to use this array to storage some data in, you should declare that array as variable.
In case that you declare your array as constant it will be stored in ROM and you will not be able to change data in this array.
Values of the memory locations should be assigned with some values.
Best regards,
Aleksandar