-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cpu/esp*: fix linker scripts #15186
cpu/esp*: fix linker scripts #15186
Conversation
I think we can also revert d59fd84 now. |
good job @leandrolanzieri!
would you do that and then enable CI tests & build? |
Done! I reverted the blacklisting commit and triggered the CI. |
Should I disable |
The test application itself is calling I could instead remove both calls and leave |
I would remove the extra call, unless there is a reason for late initiation @miri64? |
The reason for |
Yes I know, I was not playing hot potato, just asking if it was safe to remove. |
Opened. |
This reverts commit d59fd84.
d59eaa3
to
b897637
Compare
Only failure due to #15066 it seems |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tests succeed again now, failure on samr21 is unrelated.
Backport provided in #15197 |
Thanks for the review! |
An observation (not sure if related):
edit only happens when I use This is 'fixed' by doing --- a/cpu/esp32/ld/esp32.common.ld
+++ b/cpu/esp32/ld/esp32.common.ld
@@ -129,6 +129,7 @@ SECTIONS
*spiffs/*(.literal .text .literal.* .text.*)
*syscalls.o(.literal .text .literal.* .text.*)
*vfs/*(.literal .text .literal.* .text.*)
+ *at86rf2xx/*(.literal .text .literal.* .text.*)
/* part of the RIOT port that should run in IRAM */
*cpu/*(.literal .text .literal.* .text.*) but that can't be the proper solution. |
@@ -286,7 +286,7 @@ SECTIONS | |||
*libc.a:*fputwc.o(.literal .text .literal.* .text.*) | |||
*/ | |||
|
|||
enc28j60.a:*(.literal .text .literal.* .text.*) | |||
*enc28j60/*(.literal .text .literal.* .text.*) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's with this random driver getting special treatment 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure, maybe @gschorcht can clarify?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, yes I can clarify. In section Network Devices of the ESP8266 documentation it is mentioned that ESP8266 is working and has been tested with ENC28J60 and MRF24J40. However, the ENC28J60 works only if the driver code is placed in IRAM.
Since the IRAM of the ESP8266 is very limited and only has a size of 48 kByte, it is not possible to place code segments in the IRAM by default. The IROM of the ESP8266 on the other hand has 448 kByte. The IRAM is of course much faster, while the IROM is much slower and can only be accessed via a cache, which is also sometimes disabled, e.g. by the WiFi module or when writing to the flash.
Therefore, time-critical code as well as code that has to work even when the cache is disabled must be placed in the IRAM. Due to the limited size of the IRAM, fine-tuning is always required as to what must be placed in the IRAM and what can be placed in the IROM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IROM is much slower and can only be accessed via a cache, which is also sometimes disabled, e.g. by the WiFi module
The WiFi module disabling the cache is surprising! Wouldn't that mean that any code can be hit by the problem if another task gets scheduled while the WiFi driver has the cache disabled? Or are interrupts disabled together with the cache?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benpicco I'm not really sure (I just forgot too much in last 2 years doing other things 😟), but when I remember correctly, I had problems to access IROM when the WiFi module was active. So my guess at that time was (without knowing it definitely, there is no documentation) that it might be that the WiFi module is connected via SPI inside the SoC. That's why esp_wifi
is already in IRAM. I could try it again.
Contribution description
esp32 and esp8266 specify some modules' object files on their linker scripts. #14754 changed the compilation of RIOT modules, so archives are not generated anymore. This was causing the wildcards on the linker scripts to not match the object files. This PR fixes this issue by using the folder instead of the archive name.
With these changes esp8266 is working again, and for esp32 I ran the mtd test successfully (#15123).
Testing procedure
Issues/PRs references