Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic user defined linker script esp8266 (Read 985 times)
Christoph
Junior Member
**
Offline


Posts: 40
Joined: Sep 4th, 2020
user defined linker script esp8266
Jun 25th, 2024 at 2:40pm
Print Post  
Hello,

I would like to define some address of some dataType like

rtcData data1 __attribute__((section(".rtcDataSection"))) = {
    "Berni167",
    0,
    0,
    0xFFFF
};

SECTIONS
{
    .rtcDataSection 0x3FFE8000 : ALIGN(4)
    {
        KEEP(*(.rtcDataSection))
    }

    /* Include the rest of the original linker script content here */
}

ChatGPT told me I have to define the .rtcDatSection in my linker script the compiler is using. 
So my question, where do I find the right now used one?

In the added output.txt there are a few results when I search for .. .ld endings and at the end there is the 

menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld

Can someone explain which one I can copy paste and how to define in the board.txt , so the compiler knows which one to use?

Many thanks in advance,
Christoph


  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2704
Joined: Feb 13th, 2019
Re: user defined linker script esp8266
Reply #1 - Jun 25th, 2024 at 4:39pm
Print Post  
Thanks for the log, there seems to be a multi-step process involved on the newer ESP8266 toolchains, however it looks reasonably simple.....

It is often best to inspect the one that is there and clone it to a location outside of the board package (e.g. your project folder where the main INO is), so it is not lost with the next board package version update.

So for example, we can override the Flash Size selection properties from the board menu for a single selection:

1) Ensure the Board Option "Flash Size" to be "Mapping defined by Hardware and Sketch" (as it is the one selected to override in the attached entries).

2) Copy the Current files to your project folder:
a) ools/sdk/ld/eagle.flash.auto.ld
b) ools/sdk/ld/eagle.app.v6.common.ld.h
c) ools/sdk/ld/eagle.app.v6.common.ld.vtables.h

3) Add a Local board.txt to your project, and paste in the contents of the attached text file.

That should be it I believe....
  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Christoph
Junior Member
**
Offline


Posts: 40
Joined: Sep 4th, 2020
Re: user defined linker script esp8266
Reply #2 - Jun 25th, 2024 at 9:35pm
Print Post  
Thank you very much for quick response and great help Simon!!
  
Back to top
 
IP Logged
 
Christoph
Junior Member
**
Offline


Posts: 40
Joined: Sep 4th, 2020
Re: user defined linker script esp8266
Reply #3 - Jul 11th, 2024 at 1:10pm
Print Post  
Hello again Simon,

now after using the data with user defuined variable, I encountered some unexpected behaviour. 
The 
rtcData data1 = {
     "Berni167",
     0,
     "/rec_2024-12-31__23-59-59.csv",
     0,
     0xFFFF
};

is not inititialized when adding __attribute__((section(".rtcDataSection")))

although I have the expected address defined in the eagle.app.v6.common.ld.h , but no data written on this memory, or atleast not the expected one.

My workaround was just define the data1 in the setup() and this worked. I investigated some more and there should be some startup (startup.s) file which tells the processor what to do before main() and where to copy data from e.g. flash to RAM. Do I miss out some file where I have to define the init values from rtcData data1 , or is there some better way to clarify the init values for data1?

Many thanks  Smiley in advance,
Christoph

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint