This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2541: The problem that the image stored in the flash area cannot be displayed normally

Part Number: CC2541
Other Parts Discussed in Thread: CC2510, CC2540

Hi Team,

When storing pictures on the cc2541, if there is a ram area, the display is normal. After adding the keyword CODE, there is a flash area, and the display is abnormal. What is the reason and how to configure it?

With the same code, I find there is no problem with CC2510.

const unsigned char CODE gImage_njzy[12500] = {
0X7F,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0X7F,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFE,0X7F,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0X7F,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,

....

}

I added the keyword “CODE”, but it seemed that it wasn't stored into flash.

Regards,

Katherine

  • Hi Katherine,

    Can you specify what the CODE macro is defined as? I am unsure what this keyword does. Is this a custom macro the customer has implemented?

    Best Regards,

    Jan

  • Hi Jan,

    I may have solved this problem, but I still don't know the principle. First, I need to configure the link file. It'd be better to use the "ti_51ew_cc2540b.xcl", and its location is in the protocol stack "BLE-CC254x-1.3.2\Projects\ble\common\cc2540", and I need to execute "__low_level_init( void);" function, located in the module "BLE-CC254x-1.3.2\Components\hal\target\CC2540EB\hal_startup.c".

    Regards,

    Katherine

  • Hi Katherine,

    I am very glad to hear the problem seems to be solved. I would suggest testing thoroughly to ensure the solution is stable and works with different data strings. Thank you for sharing the fix that you have found with the community!

    Best Regards,

    Jan