-
Notifications
You must be signed in to change notification settings - Fork 536
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(system): add exception handler for load store exception
internal gitlab: a3b74e9c
- Loading branch information
1 parent
67bdd07
commit c766134
Showing
19 changed files
with
62 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
gwen: | ||
at : 754dddb | ||
crypto : 350448e | ||
espnow : 350448e | ||
json : ce90efd | ||
main : 754dddb | ||
net80211 : 350448e | ||
pp : 097de86 | ||
smartconfig : 350448e | ||
ssl : b19a6f7 | ||
upgrade : 5287040 | ||
wpa : 350448e | ||
wpa2 : 350448e | ||
wps : 350448e | ||
at : bc85feb | ||
crypto : bc85feb | ||
espnow : bc85feb | ||
json : bc85feb | ||
main : bc85feb | ||
net80211 : bc85feb | ||
pp : bc85feb | ||
smartconfig : bc85feb | ||
ssl : bc85feb | ||
upgrade : bc85feb | ||
wpa : bc85feb | ||
wpa2 : bc85feb | ||
wps : bc85feb | ||
|
||
phy: | ||
phy : 1136 | ||
|
||
gitlab: | ||
driver : 68fc7b06 | ||
lwip : c097d4cf | ||
mbedtls : e4dace14 | ||
lwip : 3c7a0dbe | ||
mbedtls : 3c7a0dbe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c766134
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.
with this fix I got much more free heap than before.
At system startup the free heap size reported with system_get_free_heap_size() grows from 38912 to 74160 byte. What has happend? Where does the additional free memory come from? Or is that fake?
Viele Gruesse
Axel
c766134
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.
Will SSL connections benefit from the increased heap? This has been the bottleneck in the past versions.
c766134
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.
Hi,
We do some optimization about malloc, and got some iram space as memory.
c766134
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.
@kriegste Yes, it can work for SSL conenctions and WPA2 enterprise.
We modified the action of os_malloc, and the os_malloc_dram is the same as os_malloc in the old version, the os_malloc is allocated from iram, which is added in the commit.
c766134
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.
Could you please explain difference between os_malloc and os_malloc_dram and when each of them can used? Will this change be reflected in NON OS SDK document?
c766134
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.
Hi @valkuc ,
Now os_malloc allocates memory from iram, and os_malloc_dram allocates memory from dram.
If you operate memory that is not four byte aligned, which is allocated by os_malloc, an exception will be generated, and we do something in the exception handler to read/write the correct data, then restore from exception. So os_malloc_dram is more efficient than os_malloc. In most instances, os_malloc works good but in Wi-Fi interrupt, which operation is in the liblwip.a and libpp.a.
By default, in order to keep efficient, os_malloc_dram is used in the library, and os_malloc is for the user. If you need efficient code, you can also use os_malloc_dram instead of os_malloc.
c766134
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.
Am I correctly understand that previously os_malloc allocated memory from DRAM and now to make our code compatible with this change we need to replace all occurrences of os_malloc with os_malloc_dram?
c766134
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.
Yes, if the dram is enough for you, you can replace it, even though you don't do it, it should work well.
And if you need more memory, like creating more ssl connections, you'd better using os_malloc.
It will be allocated from dram automatically, if malloc memory fail from iram. But if you use os_malloc_dram to malloc, it will fail when dram is insufficient, and it doesn't be allocated from iram automatically.
c766134
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.
Thanks, now all clear. It will be good if this will be documented somewhere.
c766134
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.
Thanks for your advice, we will add it ASAP.
c766134
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.
Is the new exception handler compatible with the gdbstup? I have seen some SIGSEGV debugging with gdb and gdbstub that make me doubt it.
Please make debugging with gdb and gdbstub work again.
Viele Gruesse
Axel
c766134
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.
@ataweg Sorry, it is for load/store data in iram.
c766134
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.
That's exactly what I'm watching. If an unaligned value or 8/16 bit value is written or read to/from the iram, gdb reports a SIGSEGV.