Skip to content
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

ulp I_RD_REG compile error #297

Closed
xiangjunhuang opened this issue Jan 25, 2017 · 6 comments
Closed

ulp I_RD_REG compile error #297

xiangjunhuang opened this issue Jan 25, 2017 · 6 comments
Labels
Type: Bug bugs in IDF
Milestone

Comments

@xiangjunhuang
Copy link

Clearly it's a typo:

diff --git a/components/ulp/include/esp32/ulp.h b/components/ulp/include/esp32/ulp.h
index f4e37e9..179d1ee 100644
--- a/components/ulp/include/esp32/ulp.h
+++ b/components/ulp/include/esp32/ulp.h
@@ -320,7 +320,7 @@ static inline uint32_t SOC_REG_TO_ULP_PERIPH_SEL(uint32_t reg) {

  • R0 = reg[high_bit : low_bit]
  • This instruction can access RTC_CNTL_, RTC_IO_, and SENS_ peripheral registers.
    */
    -#define I_RD_REG(reg, low_bit, high_bit, val) {.wr_reg = {
    +#define I_RD_REG(reg, low_bit, high_bit, val) {.rd_reg = {
    .addr = reg & 0xff,
    .periph_sel = SOC_REG_TO_ULP_PERIPH_SEL(reg),
    .unused = 0, \
@xiangjunhuang
Copy link
Author

I tried to this I_RD_REG in my project, but seems the result I got is incorrect. Can someone please confirm if this is really implemented in esp-idf 2.0 release?

@igrr
Copy link
Member

igrr commented Jan 25, 2017

Thanks for reporting this. We'll fix the issue before v2.0.

@igrr igrr added this to the v2.0 milestone Jan 25, 2017
@igrr igrr added the Type: Bug bugs in IDF label Jan 25, 2017
@xiangjunhuang
Copy link
Author

Thanks @igrr for your quick response! did you get chance to test after .wr_reg -> .rd_reg? Can it really readback right value from a register? I did this in on my board, but not working as expected somehow.

@igrr
Copy link
Member

igrr commented Jan 26, 2017

There is a bug in the definitions of I_RD_REG/I_WR_REG, we'll have a fix shortly.

@xiangjunhuang
Copy link
Author

xiangjunhuang commented Feb 3, 2017

@igrr, even AFTER I fixed the I_RD_REG definition locally, I still cannot read correct value from this instruction. Can you please confirm if that works for you? I'm sure the initial settings are OK, and I can read correct value from api rtc_gpio_get_level(...).

@igrr igrr closed this as completed in 0483548 Mar 8, 2017
@igrr
Copy link
Member

igrr commented Mar 9, 2017

The bugs related to I_RD_REG have been fixed in master now. Please give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

2 participants