forked from micropython/micropython-esp32-ulp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix translation of peripheral register addresses
This was already incorrect in the original ESP32 implementation but was discovered while testing the new S2/S3 implementation. This was also wrong within the ESP-IDF, that we based the translation logic on. Espressif fixed the issue in this pull request: espressif/esp-idf#11652 We now also have unit tests and compat (integration) tests, that compare our binary output against that of binutils-gdb/esp32-ulp-as, which already did this translation correctly, but we didnt have a test for the specific cases we handled incorrectly, so we didn't notice this bug. This fix has also been tested on a real device, because S2/S3 devices need the IOMUX clock enabled in order to be able to read GPIO input from the ULP, and enabling that clock required writing to a register in the SENS address range, which didnt work correctly before this fix.
- Loading branch information
Showing
7 changed files
with
116 additions
and
5 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
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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "soc/rtc_cntl_reg.h" | ||
#include "soc/soc_ulp.h" | ||
|
||
reg_rd 0x012, 1, 2 | ||
reg_rd 0x234, 3, 4 | ||
reg_rd 0x345, 5, 6 | ||
|
||
reg_wr 0x012, 1, 2, 1 | ||
reg_wr 0x234, 3, 4, 1 | ||
reg_wr 0x345, 5, 6, 1 | ||
|
||
WRITE_RTC_REG(0x3ff484a8, 1, 2, 3) | ||
READ_RTC_REG(0x3ff484a8, 1, 2) | ||
WRITE_RTC_REG(0x3ff48904, 1, 2, 3) | ||
READ_RTC_REG(0x3ff48904, 1, 2) |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "soc/rtc_cntl_reg.h" | ||
#include "soc/soc_ulp.h" | ||
|
||
reg_rd 0x012, 1, 2 | ||
reg_rd 0x234, 3, 4 | ||
reg_rd 0x345, 5, 6 | ||
|
||
reg_wr 0x012, 1, 2, 1 | ||
reg_wr 0x234, 3, 4, 1 | ||
reg_wr 0x345, 5, 6, 1 | ||
|
||
WRITE_RTC_REG(0x3f4084a8, 1, 2, 3) | ||
READ_RTC_REG(0x3f4084a8, 1, 2) | ||
WRITE_RTC_REG(0x3f408904, 1, 2, 3) | ||
READ_RTC_REG(0x3f408904, 1, 2) |
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