VS Arduino
Visual Micro >> General Board >> Linker Map file?
https://www.visualmicro.com/forums/YaBB.pl?num=1558294142

Message started by mgarber on May 19th, 2019 at 7:29pm

Title: Linker Map file?
Post by mgarber on May 19th, 2019 at 7:29pm
I see a couple of discussions about where the file should be, but mines not there.
Ive got .cc.o, .cpp.d, .elf files, and the .bin file but thats it.

Please help.  Thanks!


Title: Re: Linker Map file?
Post by Visual Micro on May 19th, 2019 at 7:34pm
By default, this is controlled by whatever tool chain you have installed. Please follow the instructions at the top of this forum so that we can help.

Title: Re: Linker Map file?
Post by mgarber on May 20th, 2019 at 3:47pm
oops... sorry about that....
(see attached)

https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=VeboseOut.txt ( 44 KB | 4 Downloads )

Title: Re: Linker Map file?
Post by Visual Micro on May 20th, 2019 at 4:48pm
Okay so you are using nodeMCU. It's worth asking on their forum what the compiler flag is then I can tell you how to add it (F$ project properties)

Alternatively if you look at project properties there is "Micro build stats>disassembled view" which gives some reporting. You can also extend that with its own switches. If you enable this reporting then you will see an output window (see the output windows combobox) called "Micro Disassembly" after each build.

Title: Re: Linker Map file?
Post by mgarber on May 20th, 2019 at 5:28pm
My initial excitement was dampened by the fact that Micro build stats>disassembled view = TRUE crashes VStudio at the last step of creating the disassembly.

The linker flags I need to add are -Wl,-Map,YourProject.map -Wl,--cref (with the cref optional for cross referencing).

Title: Re: Linker Map file?
Post by Visual Micro on May 20th, 2019 at 8:29pm
Hmm I'll give that a try for nodemcu thanks

1)

You might be able to override the linker flags in the F4 "project properties". See "extra flags link"

-Wl,-Map,YourProject.map -Wl,--cref

2)

or you can add the linker flags by overriding the default build properties. Notice in your verbose output the property compiler.c.elf.flags=. I think that's what you want.

A. Either edit the platforms.txt file directly. You can find that location by hovering the mover over the tool chain in board manager and clicking the "View source" link that appears in the preview at the bottom of board manager. normally c:\users\yourname\appdata\local\arduino15\packages\esp....\ver

B Or create a board.txt in your project and add the command to that. The board.txt overrides the core. This is is how might look, notice I have added YOUR_FLAGS to the end


Code (]compiler.c.elf.flags=compiler.c.elf.flags=-g {compiler.warning_flags} -Os -nostdlib -Wl,--no-check-sections -u call_user_start {build.float} -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-L{compiler.libc.path}/lib" "-T{build.flash_ld}" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read YOUR_FLAGS[/code):



If you have copy output to intermediate enabled then the output should end up in project property pages>intermediate_folder\config_name
[code]C:\Users\YOUR_NAME\Documents\Visual Studio 2017\Projects\Tracker1.0\Release


but in any case it will be in the temp build folder
[code]C:/Users/YOUR_NAME/AppData/Local/Temp/VMBuilds/Tracker2/esp8266_nodemcuv2/Release[/code]


All of this can be seen in the verbose output should you want to delve in.

Title: Re: Linker Map file?
Post by mgarber on May 21st, 2019 at 12:20am
Im getting closer... it has to be added to the  "Extra c.elf flags" : -Wl,-Map,YourProject.map

Linked without barfing but didnt produce any file :(

Im talking(?) with the MCU guys to see what they know.  Is it an order thing?
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=VerboseOut_mapflags2_false_success.txt ( 38 KB | 1 Download )

Title: Re: Linker Map file?
Post by mgarber on May 21st, 2019 at 12:33am
Stop the presses!!!    I found it at C:\Users\<yourNameHere>\AppData\Local\VirtualStore\Program Files (x86)\Arduino\java\bin.

....well.....  better here than nowhere, eh?


(Now to find where my exception was occurring)

Title: Re: Linker Map file?
Post by Visual Micro on May 21st, 2019 at 11:46am
Great, I forgot to say that you should click Rescan or restart the ide after making core changes in the underlying platform. But maybe you found that out already :)


Title: Re: Linker Map file?
Post by Visual Micro on Jun 16th, 2019 at 9:58pm
Reading this again the file should not be in that folder. It sounds like it is creating the file in the working directory as opposed to the build folder. We will have to change the working directory to the build folder when running these events

VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.