Variables are not initialized (RAM with address 0x10000000)

Sysprogs forums Forums VisualGDB Variables are not initialized (RAM with address 0x10000000)

This topic contains 5 replies, has 2 voices, and was last updated by  support 1 day, 3 hours ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #27034

    Maria
    Participant

    Hi,

    I have an issue that is described here https://visualgdb.com/tutorials/arm/linkerscripts/

    The variables that has addresses from 0x10000000 are not initialized properly. It is RAM, so they should.

    I’m using ARMCC Keil toolchain and I have a scatter file for Keil, so the solution with NOLOAD is not relevant for me.

     

    Also I tried to add this part of RAM to Additional memories, but when I press OK, I catch VS Exception “Value cannot be null. Parameter name: path2”

    I’m not sure how should I fix it with all this conditions.

    I will be happy for any help.

    Maria

    #27060

    support
    Keymaster

    Hi,

    Sorry, the Additional Memories window only works for GCC-based projects, however we can help you configure your Keil-based project to achieve similar results.

    Please make sure that the CCM memory in your scatter file (e.g. RW_IRAM2 shown below) is inside the main load region (LR_IROM in the example below). It will ensure that its contents get programmed into the FLASH memory and the Keil startup code copies them into the actual CCMRAM before calling main().

    Below is an example of a Keil scatter file defining both RAM and CCMRAM memories:

    You can place a specific variable into the CCM memory by declaring it with the section attribute:

    If this still doesn’t work, please let us know and we will help.

    #27062

    Maria
    Participant

    Hi!

    Thank you for your response!

    Here is my scatter file. I woks fine when I run the project from Keil. All my RAM sections is inside LR_IROM1 block.

    I’m using attribute section only for SPI DMA buffers. In all other cases I rely on the linker and I have no preferences where to put other variables.

    Should I make any changes in my scatter to make it work in VS?

    LR_IROM1 0x08000000 0x00200000 { ; load region size_region
    ER_IROM1 0x08000000 0x00200000 { ; load address = execution address
    *.o (RESET, +First)
    *(InRoot$$Sections)
    .ANY (+RO)
    .ANY (+XO)
    }
    DMA_BUFFER 0x20000000 0x500 {
    *(.dma_buffer)
    }
    RW_IRAM1 0x20000500 0x00030000 { ; RW data
    .ANY (+RW +ZI)
    }
    RW_IRAM2 0x10000000 0x00010000 {
    .ANY (+RW +ZI)
    }
    }

    • This reply was modified 6 days, 13 hours ago by  Maria.
    #27076

    support
    Keymaster

    Sorry, we tried reproducing the problem with your scatter file (we reduced IRAM1 size to 0x4000 and IRAM2 size to 0x8000), but it did work as expected with the following variable:

    It did get placed into IRAM2 and got initialized correctly. Most likely, some other project setting is interfering with this on your side.

    If it still doesn’t work for you, please try reproducing the problem on a clean project and share the exact repro steps that we could follow on our side (see our problem reporting guidelines). If we could reproduce the problem in our environment, we should be able to suggest a workaround, or release a hotfix resolving it.

    #27145

    Maria
    Participant

    I created a new project as you described, and yes, it works.

    But I still didnt succeed to make my big project work. I checked all settings and I don’t see any difference that could lead to this problem. Furthermore, after all my attempts my project starts to fall into hard fault immediately after the start (Received a SIGTRAP: Trace/breakpoint trap).

    I attached my scatter and my map file (I only change it to txt).

    Also here is command like for compilation:

    -I”..\master\console\console\Middlewares\Third_Party\FatFs\src\drivers” -I”..\master\console\console\Middlewares\ST\STM32_USB_Device_Library\Core\Inc” -I”..\master\console\console\Middlewares\ST\STM32_USB_Device_Library\Class\CDC\Inc” -I”..\master\console\console\Middlewares\ST\STM32_USB_Host_Library\Core\Inc” -I”..\master\console\console\Middlewares\ST\STM32_USB_Host_Library\Class\MSC\Inc” -I”..\master\console\console\Middlewares\Third_Party\FatFs\src” -I”..\master\console\console\Console\Drivers” -I”..\master\console\console\Console\Drivers\wifi\winc1500\host_drv” -I”..\master\console\console\Console\Drivers\wifi\winc1500\host_drv\driver\source” -I”..\master\console\console\Console\Source” -I”..\master\console\console\Console\Source\GUI” -I”..\master\console\console\Console\Source\GUI\Screens” -I”..\master\console\console\Console\Source\GUI\Fonts” -I”..\master\console\console\lwip\src\include” -I”..\master\console\console\lwip\src\include\ipv4″ -I”..\master\console\console\lwip\system” -I”..\..\Packs\CMSIS-FreeRTOS\10.2.0\CMSIS\RTOS2\FreeRTOS\Include” -I”..\..\Packs\CMSIS-FreeRTOS\10.2.0\CMSIS\RTOS2\FreeRTOS\Include1″ -I”..\..\Packs\CMSIS-FreeRTOS\10.2.0\Source\include” -I”.\RTE\RTOS” -I”..\..\Packs\CMSIS-FreeRTOS\10.2.0\Source\portable\RVDS\ARM_CM4F” -I”..\..\Packs\CMSIS\5.6.0\CMSIS\RTOS2\Include” -I”..\..\Packs\CMSIS\5.6.0\CMSIS\Core\Include” -I”..\master\console\console\Inc” -I”..\..\Packs\CMSIS\5.6.0\CMSIS\Core_A\Include” -I”D:\playground\VS_import_playground\master\console\Packs\CMSIS\5.6.0\CMSIS\Core\Include” -I”RTE” -I”../master/console/Packs/CMSIS/5.6.0/CMSIS/RTOS2/Include” -I”D:\playground\VS_import_playground\master\console\Packs\CMSIS-FreeRTOS\10.2.0\CMSIS\RTOS2\FreeRTOS\Include1″ -I”../master/console/console/MDK-ARM/RTE/RTOS” -I”../master/console/Packs/CMSIS-FreeRTOS/10.2.0/CMSIS/RTOS2/FreeRTOS/Include” -I”../master/console/Packs/CMSIS-FreeRTOS/10.2.0/Source/include” -I”..\master\console\console\Drivers\STM32F4xx_HAL_Driver\Inc” -I”..\master\console\console\Drivers\STM32F4xx_HAL_Driver\Inc\Legacy” -I”D:\playground\VS_import_playground\master\console\Packs\CMSIS-FreeRTOS\10.2.0\Source” -I”..\master\console\Packs\CMSIS-FreeRTOS\10.2.0\Source\portable\RVDS\ARM_CM4F” –apcs=interwork -O0 -g -D”USE_HAL_DRIVER” -D”STM32F429xx” -D”DEBUG=1″ –gnu –c99 –split-sections “VisualGDB\Debug\”

    And command line for the linker:

    -o “D:\playground\VS_import_playground\Attempt3\VisualGDB\Debug\Attempt3” –info unused –info sizes –scatter “Clear_for_Keil.sct” –xref –info summarysizes –map –info totals “RMS_Console_map” –symbols –strict –callgraph –emit_relocs –info veneers

    I really need your help. Thank you.

    • This reply was modified 1 day, 12 hours ago by  Maria.
    Attachments:
    You must be logged in to view attached files.
    #27155

    support
    Keymaster

    Hi,

    Sorry, in order to troubleshoot a specific project that doesn’t come from us, we would need to charge a consulting fee, as it takes non-trivial time to go through all the settings and source code and find the exact cause of the problem. If you would like to go ahead, please contact our sales to get a quote.

    An alternative would be to create a new project from scratch and then move your existing code to it step-by-step, verifying that the additional memory loading works after each step (consider creating a local git repository and checking in the changes after each step to track them better). This would require some time, but should help you find the root cause of the problem on your side.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.