Atollic deletes .elf files

Discuss how to use the features of Atollic TrueSTUDIO, including the editor, assembler, C/C++ compiler, linker, debugger, static code analysis and team collaboration tools.

Moderators: Markus Girdland, Mattias Norlander

hal_atollic
Posts: 19
Joined: Wed Sep 07, 2016 6:00 pm

Atollic deletes .elf files

Postby hal_atollic » Wed Nov 22, 2017 1:42 pm

Using Atollic 8.0.0 on W10, L433 build and HAL library 1.10.0 without Cube MX.

Built 3 bare embedded projects in a workspace and set the Debug Configuration to ST-Link. A .elf file was properly included in the Debug folder for all 3 projects. Sometime in the process of modifying the bare projects by replacing main.c, adding other source files and rebuilding, the .elf files get deleted from the second and third projects.

Don't know if this is significant, but the workspace is in the E: drive while Atollic is in the C: drive.

Anybody have any clues as to what is happening?

Update: Even with just one project in a workspace, editing by replacing main.c and adding a few more source files to the src folder using Windows Explorer results in the .elf being deleted during the next build.

Cheers, Hal

hal_atollic
Posts: 19
Joined: Wed Sep 07, 2016 6:00 pm

Re: Atollic deletes .elf files

Postby hal_atollic » Wed Nov 22, 2017 7:31 pm

Problem isolated but not solved. In the following code selection from one of the added files, removing the comment slashes then rebuilding produces no error messages, but the .elf file is deleted.

uint16_t ESPCommand;
uint16_t CheckSum;
//const uint16_t Tens[6] = {30000, 10000, 1000, 100, 10, 1};
const uint8_t FunctionErrorString[] = " Function Error ";
const uint8_t ReadyString[] = " Ready ";

Unless I have overlooked something, this looks like a task for Mattias and his happy crew of IDE development elves.

Cheers, Hal

hal_atollic
Posts: 19
Joined: Wed Sep 07, 2016 6:00 pm

Re: Atollic deletes .elf files

Postby hal_atollic » Thu Nov 23, 2017 3:09 pm

Problem further characterized - workaround found.

TS 8.0.0 and TS 8.1.1 apparently cannot properly handle initializing a constant or variable array of integers outside of main. If the syntax was wrong, an error message should show up. But the only symptom is the .elf file deletion. This code previously worked fine on TS 7 and earlier variants.

The workaround is to declare a variable array uint16_t Tens[6]; , then initialize each element in main. But I would prefer to have the option of constant arrays in flash memory space.

Cheers, Hal

hal_atollic
Posts: 19
Joined: Wed Sep 07, 2016 6:00 pm

Re: Atollic deletes .elf files

Postby hal_atollic » Sat Nov 25, 2017 9:22 pm

Problem solved - but Atollic still has work to do.

The problem was duplicated identical statements in different source files initializing the constant matrix. Deleting one fixed the .elf file deletion.

TS somehow recognized the duplication and therefore didn't build a launch file. But there was no error message, so I believe that Atollic should investigate why.

Cheers, Hal

Markus Girdland
Posts: 21
Joined: Thu May 11, 2017 11:27 am

Re: Atollic deletes .elf files

Postby Markus Girdland » Mon Nov 27, 2017 1:10 pm

Hello Hal,

Nice catch! I've made a ticket about it and hopefully we can be more clear what happens with this error. I thought it was weird that this should have worked on previous versions so I tried it with 7.1 and it does seem to get the build error, and hence not create the .elf file, in that version as well. At least for me.

This does generate a build error, which is why the .elf file is never created but it is not conveyed clearly to the user, which is what I wrote my ticket about. It's written in the console as:
"src\stm32f10x_it.o:(.rodata.Tens+0x0): multiple definition of `Tens'"

As a temporary workaround you could add a custom error for this by doing these steps:
1. Right click the project in the project explorer and go to Properties
2. C/C++ Build -> Settings -> Error Parsers tab
3. Select GNU Linker Error Parser and click the blue link "Workspace Settings."
4. Select GNU Linker Error Parser and click "Add...", the lower one of the two.
5. In Pattern you could write (.*)mutliple definition(.*) and for example the description can simply say "Multiple definitions"
6. Done! The next time you try to build it will generate an error in the "Problems" view


Return to “Atollic TrueSTUDIO tool discussions”

Who is online

Users browsing this forum: No registered users and 1 guest