Sysprogs forums › Forums › VisualGDB › PROBLEM ADDING SECTION TO LINKER SCRIPT
- This topic has 6 replies, 2 voices, and was last updated 2 years, 2 months ago by milamber.
-
AuthorPosts
-
July 22, 2022 at 19:44 #32861milamberParticipant
I am using the latest version of visualgdb and I am trying to add a new section in the stm32h7a3 linker script. I have seen the info in your tutorials https://visualgdb.com/tutorials/arm/linkerscripts/ and the forum posts here https://sysprogs.com/w/forums/topic/problem-adding-section-to-linker-script/
This is my code
#define DMA_BUFFER \
__attribute__((section(".dma_buffer")))
#endif
DMA_BUFFER uint8_t rx_buf[COUNT][LENGTH];
This is the linker script, which is copied in the project folder using the visualgdb project properties button:
MEMORY
{
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K
DTCMRAM1 (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
DTCMRAM2 (xrw) : ORIGIN = 0x20010000, LENGTH = 64K
RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 1024K
RAM_CD (xrw) : ORIGIN = 0x30000000, LENGTH = 128K
RAM_SRD (xrw) : ORIGIN = 0x38000000, LENGTH = 32K
}/* Define output sections */
SECTIONS
{
.dma_buffer : /* Space before ':' is critical */
{
*(.dma_buffer)
} >RAM_CD
Although this setup works and places the variable in the correct memory section when the project type is ’embedded project wizard’, it fails when the project type is ‘stm32cubemx project wizard’
this is the memory utilization report when project is ‘stm32cubemx project wizard’
------------------- Memory utilization report -------------------
Used ITCMRAM: 0 bytes out of 64KB (0%)
Used FLASH: 51KB out of 2048KB (2%)
Used DTCMRAM1: 0 bytes out of 64KB (0%)
Used DTCMRAM2: 0 bytes out of 64KB (0%)
Used RAM: 7488 bytes out of 1024KB (0%)
Used RAM_CD: 0 bytes out of 128KB (0%)
Used RAM_SRD: 0 bytes out of 32KB (0%)
and this is when it’s ’embedded project wizard’
------------------- Memory utilization report -------------------
Used FLASH: 53KB out of 2048KB (2%)
Used RAM_D1: 1148 bytes out of 512KB (0%)
Used RAM_D2: 48 bytes out of 288KB (0%)
Used RAM_D3: 96 bytes out of 64KB (0%)
Used DTCMRAM: 0 bytes out of 128KB (0%)
Used ITCMRAM: 0 bytes out of 64KB (0%)
I would expect that the variables will be placed correctly (RAM_D2 and RAM_CD) in both cases
July 22, 2022 at 19:45 #32862supportKeymasterPlease note that VisualGDB is a productivity tool for software developers. It can make developers more productive by providing convenient GUI for common time-consuming tasks, and integrating various external tools into Visual Studio, so that they are always a few mouse clicks away.
We are able to offer VisualGDB at affordable price, because we focus on developing and supporting functionality that works the same way for multiple users, hence the development and testing effort is reused between multiple license holders.
We also receive a huge amount of inquiries asking to fix a specific broken project, help make the correct design choice, explain how a specific C++ feature works, or assist porting a library to a different platform. These inquiries require considerable effort to research and communicate the best solution. They do not scale between multiple users. I.e. helping one user solve this type of problem will not automatically help other users. It also does not help the same user avoid the same type of problem in the future. Hence, we are not able to address them within our regular support. If we included this type of help in our support, we would simply not have sufficient resources to provide it at the current license prices, or to allocate any resources to VisualGDB development.
We are happy to offer project-specific help via our consulting service per Zoom, TeamViewer or any other screen sharing service of your choice. We charge a fixed rate for these sessions (billed in 1/2-hour increments), and are happy to solve any problems our users encounter. The rate includes a detailed follow-up email at the end of the session, that includes an overview of the used techniques and a summary of solved problems and future recommendations.
Alternatively, please consider browsing our documentation and tutorials. Our documentation lists most VisualGDB settings, and the tutorials show how to use VisualGDB for in many real-world scenarios. Our technical support is limited to issues in VisualGDB itself, that can be reproduced from scratch per our problem reporting guidelines (i.e. do not depend on external projects that can potentially contain errors).
July 22, 2022 at 19:48 #32863milamberParticipantI am not sure I follow. your product claims to be able to parse linker files correctly, yet is fails to do so when different project types are used. why this is a project support request??
July 22, 2022 at 20:39 #32864supportKeymasterIf you believe VisualGDB is not working correctly, please provide complete and detailed steps to reproduce the issue as described below:
- The steps should begin with launching Visual Studio. They should include every step necessary to create the project from scratch and reproduce the issue.
- Please make sure the steps do not involve any 3rd-party code as we will not be able to review it. If the problem only happens with a specific project, please make sure you can reproduce it on a clean project created from scratch.
- The steps should include uncropped screenshots of all wizard pages, VisualGDB Project Properties pages and any other GUI involved in reproducing the problem. This is critical for us to be able to reproduce the problem on our side.
You can read more about the best way to report VisualGDB issues in our problem reporting guidelines, If you do not wish to document the repro steps and save the screenshots, please consider recording a screen video instead and sending us a link to it.
Please note that many VisualGDB issues are caused by selecting an incompatible combination of settings at some point. We are generally not able to review specific projects and find the specific settings that were set incorrectly. We recommend checking the projects into source control and keeping a track of all changed settings to avoid breaking the projects.
You can also try checking various diagnostic output from various parts of VisualGDB as described on this page. Although we won’t be able to review it for a specific project unless the we can reproduce the problem from scratch, checking it might provide some clues on what is causing the unexpected behavior.
July 22, 2022 at 20:43 #32865milamberParticipantThis is a bug of visualdgb.
I flashed the smt32 and once I did that then the linker report and generated map file was updated and showed correct usage. Until I did that the linker memory report was wrong (wasn’t showing the variable in the correct place) and the variable wasn’t in the map file.
I was expecting to show the correct values and not wrong ones, without any additional step since linker usage and correct map file generation shouldn’t be depended on flashing the mpu.
July 22, 2022 at 21:06 #32866milamberParticipantWhen i relaunched visual studio and recompiled the project this is the linker report i got
------------------- Memory utilization report -------------------
Used ITCMRAM: 0 bytes out of 64KB (0%)
Used FLASH: 50KB out of 2048KB (2%) [-2632]
Used DTCMRAM1: 0 bytes out of 64KB (0%)
Used DTCMRAM2: 0 bytes out of 64KB (0%)
Used RAM: 6088 bytes out of 1024KB (0%) [-16]
Used RAM_CD: 0 bytes out of 128KB (0%) [-320]
Used RAM_SRD: 0 bytes out of 32KB (0%)
and this is once I flash the mpu once and recompile
------------------- Memory utilization report -------------------
Used ITCMRAM: 0 bytes out of 64KB (0%)
Used FLASH: 53KB out of 2048KB (2%) [+2688]
Used DTCMRAM1: 0 bytes out of 64KB (0%)
Used DTCMRAM2: 0 bytes out of 64KB (0%)
Used RAM: 6104 bytes out of 1024KB (0%) [+16]
Used RAM_CD: 320 bytes out of 128KB (0%) [+320]
Used RAM_SRD: 0 bytes out of 32KB (0%)
is this normal behaviour?
July 22, 2022 at 22:19 #32869 -
AuthorPosts
- You must be logged in to reply to this topic.