Skip to main content
Visitor II
June 29, 2021
Solved

Hi, I am using FREE RTOS on STM32F429. Facing "Data read write issue" in internal SRAM Memory address. Need help.

  • June 29, 2021
  • 1 reply
  • 811 views

I had created single task with normal priority. The task has three functions. In one function ,I am writing the 2 byte data into internal SRAM (starting address for e.g. 0x20010204) .The 2 byte data is written on memory addresses 0x20010204 and 0x20010205 respectively. But after completion of one function execution data becomes zero when program control goes into another function call.

The Function I'm using to write sram data as:

uint32_t DummyIP1;

DummyIP1 = 500;

Write_SRAM_Data(ANALOG_INPUT_1,DummyIP1); //ANALOG_INPUT_1 = 0x20010204 ;

//Function defination

void Write_SRAM_Data(uint32_t *ldMemoryAdd,uint32_t lwData)

{

*ldMemoryAdd = lwData;

}

Please suggest that this method is correct or not. If not then suggest correct method for data writing into internal SRAM address and Bit banding addresses.

Thanks!

Anagha

    This topic has been closed for replies.
    Best answer by Walid ZRELLI

    Hello @ADank.2​ ,

    Are you sure that the memory addresses you have chosen are allocated and the linker knows about it?

    Otherwise, take a look at this reference to get an idea of how to define variables to an absolute address with gcc :

    https://mcuoneclipse.com/2012/11/01/defining-variables-at-absolute-addresses-with-gcc/

    BeST Regards,

    Walid

    1 reply

    Visitor II
    July 2, 2021

    Hello @ADank.2​ ,

    Are you sure that the memory addresses you have chosen are allocated and the linker knows about it?

    Otherwise, take a look at this reference to get an idea of how to define variables to an absolute address with gcc :

    https://mcuoneclipse.com/2012/11/01/defining-variables-at-absolute-addresses-with-gcc/

    BeST Regards,

    Walid

    ADank.2Author
    Visitor II
    July 6, 2021

    Thanks Walid. It is really helpful for me.

    Visitor II
    July 6, 2021

    Glad to help you :smiling_face_with_smiling_eyes:.