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.

TMS570LC4357: Issue with Parameter Transfer from Flash to RAM using POM Module

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Tool/software:

Hello,

We are able to successfully write data from the specified address in RAM to the Flash memory region. However, we are experiencing issues when attempting to transfer data from Flash memory to RAM.

I would like to inquire about the memory units involved in this transfer process. Could the problem be related to the positions of the addresses used in our code?

Here are the addresses we are currently using:

#define OVERLAY_BASE_ADDRESS     0x08003000U 

#define FLASH_BASE_ADDRESS         0x00200000U

Your assistance and insights on this matter would be greatly appreciated.

Best regards,

Emrullah

  • Hello,

    Our expert for this topic is out of office today, please expect a reply early next week, thanks.

    Best Regards,

    Ralph Jacobi

  • Hi Emrullah,

    Here are the addresses we are currently using:

    #define OVERLAY_BASE_ADDRESS     0x08003000U 

    #define FLASH_BASE_ADDRESS         0x00200000U

    I don't see any issues with these addresses.

    Could you please send a sample code for verification and debugging at my end?

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagadish,
    Thanks for your response. I used Halcogen library.

    #include "HL_pom.h"

    //#pragma LOCATION(test_arr,0x00220000)
    //const uint8_t test_arr[64U] = {0U};

    /** @fn void POM_Region_Config(REGION_CONFIG_t *Reg_Config_Ptr,REGION_t Region_Num)
    * @brief set the prog start address,overlay address,and size in the respective register for specified region number.
    * @param[in] Reg_Config_Ptr - this will have the prog start address and overlay addresses and size which have to be set in the registers
    * @param[in] Region_Num - Region number is used to access registers(for the specified region number)
    *
    */
    /* SourceId : POM_SourceId_001 */
    /* DesignId : POM_DesignId_001 */
    /* Requirements : HL_CONQ_POM_SR3 */
    void POM_Region_Config(REGION_CONFIG_t *Reg_Config_Ptr,REGION_t Region_Num)
    {
    /* USER CODE BEGIN (2) */
    // uint8_t get_val = test_arr[0U];
    /* USER CODE END */
    pomREG->POMRGNCONF_ST[Region_Num].POMPROGSTART = 0x00220000U;
    pomREG->POMRGNCONF_ST[Region_Num].POMOVLSTART = 0x08003000U;
    pomREG->POMRGNCONF_ST[Region_Num].POMREGSIZE = (uint32)SIZE_64BYTES;
    /* USER CODE BEGIN (3) */
    /* USER CODE END */
    }


    /** @fn void POM_Reset(void)
    * @brief Reset POM module.
    */
    /* SourceId : POM_SourceId_002 */
    /* DesignId : POM_DesignId_002 */
    /* Requirements : HL_CONQ_POM_SR4 */
    void POM_Reset(void)
    {
    /* USER CODE BEGIN (4) */
    /* USER CODE END */
    pomREG->POMGLBCTRL = 0x5U;
    /* USER CODE BEGIN (5) */
    /* USER CODE END */
    }


    /** @fn void void POM_Init(void)
    * @brief Initializes the POM driver
    *
    * This function initializes the POM driver single function handles all the regions,timeouts are also handled.
    * POM_Enable() function must be called after POM_Init() function.
    */
    /* SourceId : POM_SourceId_003 */
    /* DesignId : POM_DesignId_003 */
    /* Requirements : HL_CONQ_POM_SR2 */
    void POM_Init(void)
    {
    /* USER CODE BEGIN (6) */
    /* USER CODE END */
    pomREG->POMGLBCTRL = INTERNAL_RAM | 0x00000005U;

    /* Configure region 1 */
    pomREG->POMRGNCONF_ST[1U].POMPROGSTART = 0x08003000U;
    pomREG->POMRGNCONF_ST[1U].POMOVLSTART = 0x00220000U;
    pomREG->POMRGNCONF_ST[1U].POMREGSIZE = (uint32)SIZE_64BYTES;
    /* Configure region 2 */

    /* USER CODE BEGIN (7) */
    /* USER CODE END */
    }


    /** @fn void POM_Enable(void)
    * @brief Enable POM module.
    */
    /* SourceId : POM_SourceId_004 */
    /* DesignId : POM_DesignId_004 */
    /* Requirements : HL_CONQ_POM_SR5 */
    void POM_Enable(void)
    {
    /* USER CODE BEGIN (8) */
    /* USER CODE END */
    pomREG->POMGLBCTRL = ((pomREG->POMGLBCTRL & 0xFFFFFFF0U) | (uint32)0x0000000AU);
    /* USER CODE BEGIN (9) */
    /* USER CODE END */
    }

    /* USER CODE BEGIN (10) */
    /* USER CODE END */

  • In the example in the reference manual, on which line do we show the address in the RAM?

  • Hi Emrullah,

    My sincere apologies for the delay in the late reply. 

    I am on vacation for few days in the last week and also followed by a weekend, so didn't get a chance to work on this issue.

    Regarding your issue, i understood why POM is not working to move data from the flash to the RAM. It is because,

    Actually, the main purpose of the POM is to change the parameters of the program memory (flash). Please refer below highlighted definition once again.

    And also, you can verify the POM Region Start Address Register, the higher bits after 22 were reserved. That means we can move only the addresses up to the 22bit only.

    If you verify the address bits of the RAM it is upto 27th bit as well right, but flash addresses are upto 21 bits only.

    So, it is not possible to use the RAM memory in POM Region Start Address Register.

    And i would also like to mention that we don't need any POM to move the flash contents to the RAM. We can easily move through the pointers. Because writing into the RAM is no hard as compared with the writing into the flash.

    For example, just verify below of my code, here i using for loop and two pointers to the RAM and flash, i am simply copying the contents of the flash to the RAM.

    So, the conclusion is that POM is mainly designed to change the parameters of the program memory(flash). And to change the parameters of the RAM we can simply use the pointers.

    --
    Thanks & regards,
    Jagadish.