Is it safe to use unused register address space?
Posted: Wed Nov 20, 2019 12:38 am
It occurs to me that it would be possible to use the REG_RD and REG_WR instructions in a ULP program to effectively carve out some address space for custom purposes. I have a ULP program with a lot of boolean-type variables which are very expensive in terms of RTC memory (4 bytes each), where these REG instructions would provide a far more efficient and convenient alternative.
I've just had a quick look at the address space accessible to those instructions, and, in particular, there appears to be a huge amount of unused(?) space in the RTC_I2C_REG range: 878 contiguous bytes right up to the beginning of REG_IO_MUX, if I'm not mistaken. (0x3ff48c92 - 0x3ff49000)
Actually, I see that's now punctuated with a date code register in esp-idf 4.0, but the point stands...
Am I mistaken? Is it ok to read and write whatever I like in there?
Given how much there is to spare, I wonder if it might even be considered reserving and defining a range in esp-idf for this or any other custom purpose in a safe, future-proof way (eg. RTC_I2C_USER_DEFINED0_REG...RTC_I2C_USER_DEFINED7_REG)?
I've just had a quick look at the address space accessible to those instructions, and, in particular, there appears to be a huge amount of unused(?) space in the RTC_I2C_REG range: 878 contiguous bytes right up to the beginning of REG_IO_MUX, if I'm not mistaken. (0x3ff48c92 - 0x3ff49000)
Actually, I see that's now punctuated with a date code register in esp-idf 4.0, but the point stands...
Am I mistaken? Is it ok to read and write whatever I like in there?
Given how much there is to spare, I wonder if it might even be considered reserving and defining a range in esp-idf for this or any other custom purpose in a safe, future-proof way (eg. RTC_I2C_USER_DEFINED0_REG...RTC_I2C_USER_DEFINED7_REG)?