Jump to content

Recommended Posts

Is it possible to store a data which will never change in the flash rom by using an array ?

if so, how ?

 

piece yod

 

 

I have the same probem.

 

I have made a bootscreen for a LCD display (48 x 84), when i want to compile i'll get the following error.

 

Linking...

 

Memory Usage Report
===================
Error: No remaining RAM block (on target) big enough for:
'regel5' size:84 bytes

RAM available:368 bytes, used:347 bytes (94.3%), free:21 bytes (5.7%), 
Heap size:0 bytes, Heap max single alloc:-1 bytes
ROM available:8192 words, used:0 words (0.0%), free:8192 words (100.0%)


Failure
Done

 

Because it is a bootscreen i never change the values, so why in the RAM. With CC5X it writes in de ROM.

 

const char regel5[84] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x70,0x7b,0xdb,0xdb,0xde,0xcc,0x60,0x03,0x03,0x03,0xff,0xff,0x03,
0x03,0x03,0x00,0xc3,0xff,0xff,0xc3,0x00,0x00,0x38,0x7e,0xc6,0xc3,0xff,0xff,0x00,
0x00,0xdb,0xdb,0xdb,0xff,0xff,0x00,0x00,0xcc,0x5e,0x73,0x33,0xff,0xff,0x00,0x67,
0xc3,0xc3,0xc6,0xfc,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00
};

 

As you can see it is "const char " so it should be logical to write that array to the FLASH.

 

I am sure it is possible to write this to the ROM (else the compiler isn't worth the mony).

Link to post
Share on other sites
Use "rom char *". It will do exactly what you need: place data into code memory.

 

Regards,

Pavel

 

 

Hi i tested this

 

rom char* regel5[84] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x70,0x7b,0xdb,0xdb,0xde,0xcc,0x60,0x03,0x03,0x03,0xff,0xff,0x03,
0x03,0x03,0x00,0xc3,0xff,0xff,0xc3,0x00,0x00,0x38,0x7e,0xc6,0xc3,0xff,0xff,0x00,
0x00,0xdb,0xdb,0xdb,0xff,0xff,0x00,0x00,0xcc,0x5e,0x73,0x33,0xff,0xff,0x00,0x67,
0xc3,0xc3,0xc6,0xfc,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00
};

 

this is the error I get :

 

test.c
test.c(38:24): internal error: (temporarily) 'rom' pointers can be initialized with strings only
test.c(38:22): error: failed to initialize variable 'regel5'

failure
Failed to locate output file 'test.obj'
Done

Failed

 

 

It says 'rom' pointers can be initialized with strings only so i tried

 

rom char* regel5 = "Joni is a joni";

 

is working.

 

So this means i cant save arrays in the ROM???????????????

 

If it is possible can sombody give me an example code for array's.

 

TNX

Link to post
Share on other sites
So this means i cant save arrays in the ROM???????????????

 

If it is possible can sombody give me an example code for array's.

 

rom char *regel5 = "\0\0\0\10\20\30";

 

will store 0,0,0,10,20,30 in rom.

 

This issue already was discussed on this forum several times.

 

Regards,

Pavel

Link to post
Share on other sites

Hi,

 

It compiles now with the following code,

 

rom char* regel1 = "
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
0\0\0\0\0\0\0\0\0\0\48\118\211\211\199\254\
120\0\255\255\96\48\12\254\255\0\0\60\126\195\195\195\
195\126\60\0\14\31\27\255\255\0\0\0\0\0\0\0\
0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
0\0\0\0
";

 

but, :blink:

 

 

i get value's that i did not program.

 

I program a 0 and when i run the program in the PIC it wil send a 8 or somting, this problem does not exist for all the valeus, (it results in a hard to read string on my display)

 

When i compile i'll get the following warning (i don't know if it has something to do with it) :

 

Warning: cannot symbolize, no COFF equivalent data type for variable: 'regel1'
Building CASM file

 

What does this warning mean??? And how can i resolve this problem??

Link to post
Share on other sites

Joni83,

 

Warning: cannot symbolize, no COFF equivalent data type for variable: 'regel1'
Building CASM file

 

This message is not of concern, it just means that this cannot be watched in the debugger. The debugger gets all its information about data var data types from the coff (common object file format) file generated by the boostlink linker.

 

Regards

Dave

Link to post
Share on other sites

Hey joni, it does work. At first i tried the code and got errors as you described. But than i took another look a the for loop. The loop init more data than present and and therefor it looked the above described error ocured.

 

So you might want to check your for lus again

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...