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

Registers in the reserved area (temperature sensor in this case) #272

Open
cs2dsb opened this issue Aug 19, 2024 · 1 comment
Open

Registers in the reserved area (temperature sensor in this case) #272

cs2dsb opened this issue Aug 19, 2024 · 1 comment
Labels
registers Something is wrong with one or more registers

Comments

@cs2dsb
Copy link

cs2dsb commented Aug 19, 2024

I am interested in trying to get the internal temperature sensor working and was hoping for some insight/guidance on the best way to do this.

It seems like there are extra peripherals/registers in areas of memory documented as RESERVED in the technical reference manuals that are necessary for certain features - the temperature sensor in this case but possibly there are others.

I thought it was best to ask here since the esp-rs book says that this org includes employees from Espressif and I thought they might be able to provide an SVD for the reserved peripherals or suggest a better way than reverse engineering the definitions from the IDF header files.

Failing that, would you accept a patch to add undocumented registers to the SVDs here or would it be better if they were in a separate crate due to them being undocumented? My current plan to get it working as a PoC is just to hand write the peripheral/registerblock/etc. with hard coded addresses from the IDF. Eventually it would be nice to get the peripheral returned as part of the peripherals list from the various PACs.

The trail I followed to work out what was needed to use the temperature sensor was:

  1. temperature_sensor_install
  2. temperature_sensor_power_acquire
  3. regi2c_saradc_enable
  4. regi2c_ctrl_ll_i2c_saradc_enable
  5. ANA_CONFIG_REG 0x6000E044
  6. ANA_CONFIG2_REG 0x6000E048

These registers are in the RESERVED region according to the C3 technical reference manual and aren't in the C3 memory map but one of them IS in the S3 memory map (page 2, top right, ANA_CONFIG_REG).

The general documentation about the temperature sensor is here.

Any input on this would be gratefully received. In the meantime I'll continue hacking away at a messy, unsafe PoC to at least get some readings out to make sure it's working.

@jessebraham
Copy link
Member

Thanks for opening this issue.

I'm not sure why these registers are not included, I am not familiar with this peripheral. I would be more than happy to accept a PR adding them however, otherwise I can look into it at some point in the future.

@jessebraham jessebraham added the registers Something is wrong with one or more registers label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
registers Something is wrong with one or more registers
Projects
Status: Todo
Development

No branches or pull requests

2 participants