Change ROM start address (program memory) and reading from ROM

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi everyone,

   

I'm using a PRoC BLE module and for the program that I'm working on, I would like to reserve the first 128 bytes in the Flash ROM for saving some calibration data. So instead of starting the program memory at 0x00000000, I would like to change it to 0x00000080.

   

From the PSoC 4 TRM, it seems that we can edit the __ICFEDIT_region_ROM_start__ in the .icf file. I tried it but to no avail. Also, I tried modifying the .ld file to change the rom (rx) : ORIGIN = 0x0, LENGTH = 131072, but to no avail as well.

   

I've been trying to find relevant posts in this forum or at large but with very little success.

   

Can anyone point me in the right direction?

   

Also, I would like to read from the ROM at specific locations other than 0x00000000 as this was the only memory location which did not give me a 'incompatible integer to pointer conversion assigning to 'int *' from 'int'' error when I tried to read it using pointers.

   

Any input is very much appreciated! Thanks in advance!

   

Regards,
William
 

0 Likes
4 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

The ARM M0 processor needs the lower addresses when started. They are containing a few bytes system relevant informations.

   

There are other possibilities:

   

You can always put a variable into flash memory using the "const" specifier and an initialization.

   

With the help of the linker you can assign a fixed address (preferrably at the end of flash) to a variable.

   

There is some supervisor flash in the PSoC BLE chip (not PRoC)

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

This might help -

   

 

   

    

   

          

   

I would have liked to see a different solution like a "flash" qualifier, but GCC developers have choosen a different solution. Now the "const" qualifier has two different meanings depending on the context it appears.

   

Used in a parameter-list the consequences are: the parameter will not be modified by a direct assignment.

   

Used in a variable declaration and followed by an initialization the variable will be put into the code area which will be flash memory in all embeddeds.

   

This improvement is not ARM specific but works in GCC generally.

   

 

   

Regards, Dana.

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

 Thanks Bob and Dana for your inputs.

   

 

   

Just to share the my test results. So the objective I have now is to skip the assignment of the Start and End address of the ROM (refer to my earlier post), and to use the CyFlashWriteRow() function to write to the flash in PRoC. To read, I simply use the pointer and to avoid the 'integer to pointer error', I choose to increment the address value in the pointer instead of direct assignment. 

   

 

   

I'm sharing my code here for any future references or anyone who has a simliar problem as I did.

   

 

   

Cheers!

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

William,

   

thank you for sharing your experiences with us!

   

 

   

Bob

0 Likes