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: CC2541 difference between Logical address, Physical address and its mapping

Other Parts Discussed in Thread: CC2541, CC2540

art Number: CC2541

Hello,

I have gone through couple of threads on writing Flash memory.

Bit confused with 8051 CPU flash of 64K Bytes, CC2541 flash size of 256K bytes, Banks 0 - 7, Pages 0 - 127, Logical address, Actual/Physical address, 32K Flash occupying XDATA etc..

User guide is not clear about mapping. Below are the links I was going through.

http://e2e.ti.com/support/wireless-connectivity/bluetooth/f/538/t/319364

https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz/f/156/p/279926/977092#977092


Is there any table mapping between all these.

I was going through IAR memory map. 

There is a gap between first 64K and next 32K. Later on every alternative 32K does not have code. Why is this. Trying to understand the concept behind this.

Thanks & Regards

Vishnu Beema

  • Hi Vishnu,

    The memory addressing is documented in the CC253x/4x User´s Guide.

    Regards,
    Fredrik
  • Hi Fredrik,

    As mentioned, even I gone through User guide section 2.2 and 6. But I am not able to map between Logical address and Physical address.
  • Hi Vishnu,

    What is the actual problem? Are you having functional issues with the device?

    Regards,
    Fredrik
  • I want to use HalFlashWrite(). Trying to understand the address to be passed. Is this Logical address or Physical address. How they are mapped.
  • Hi Fredrik,

    Below is the sample code I am trying to do in SimpleBLEPeripheral_Main.c (SimpleBLEPeripheral project). But I am not able to see any data written in CC2540.

    int main(void)
    {
    /* Initialize hardware */
    HAL_BOARD_INIT();

    // Initialize board I/O
    InitBoard( OB_COLD );

    /* Initialze the HAL driver */
    HalDriverInit();

    /* Initialize NV system */
    osal_snv_init();

    /* Initialize LL */

    /* Initialize the operating system */
    osal_init_system();

    /* Enable interrupts */
    HAL_ENABLE_INTERRUPTS();

    // Final board initialization
    InitBoard( OB_READY );

    #if defined ( POWER_SAVING )
    osal_pwrmgr_device( PWRMGR_BATTERY );
    #endif

    /*--------------------------------------------------------------------------------------------------------------*/
    {
    uint32 u32Data[100] = {0};
    uint32 addr = (126u * 2048u); // Trying to write 400 bytes at Page 126
    uint16 addr1 = (addr / 4);

    memset( (void*) &u32Data[0], 0x11, 400);
    HalFlashWrite(addr1 , (uint8*) &u32Data, 100);

    uint32 u32Data1 = 0xAABBCCDD;
    addr = ((127u * 2048u) / 4); // Trying to write 4 bytes at Page 127
    HalFlashWrite(addr , (uint8*) &u32Data1, 1);
    }
    /*--------------------------------------------------------------------------------------------------------------*/

    /* Start OSAL */
    osal_start_system(); // No Return from here

    return 0;
    }

    Since I am using Page 126 and 127 (CC241 has 128 pages, 128 * 2048 = 256K), I saw memory in the range 0x78000 to 0x7FFFF. All are 0xFF.
    Please let me know where to look into Flash location and in IAR workbench memory window.

    Thanks & Regards
    Vishnu Beema
  • Hello,

    To avoid all these confusions, I prepared Excels sheet.

    This will give clear picture of 8051 Physical address, CC2540/41 256K Physical address and Logical address with Paging and BankCC2540_Memory_Analysis.xlsx.

    Thanks & Regards

    Vishnu Beema