pynrfjprog: FICR and UICR register offsets

As far as I can tell, it is not currently possible to implement the following functionality in a simple way with pynrfjprog across the various device families.

* What is the connected device hardware ID?
* What is the memory address of the UICR CUSTOMER/OTP region?

With the upcoming deprecation of the HighLevel API (https://github.com/NordicSemiconductor/pynrfjprog/blob/master/pynrfjprog/HighLevel.py#L4), the functionality goes backwards in some respects, mostly due to the removal of `get_device_info`, which contained the base offsets of the FICR and UICR regions.

To answer these two simple questions I now need to iterate through the `read_memory_descriptors()` array to find the base addresses, and then create my own device_family->register_offset mapping, populated by reading through a number of datasheets.

Have I missed some simple method to answer these questions?

Parents Reply
  • I'm not claiming that its particularly difficult to do what you have done, just that it seems odd that

    > a DLL that exports functions for programming and controlling nRF51, nRF52, nRF53 and nRF91 Series devices and lets developers create their own development tools using the DLLs API

    Does not expose basic constants for those very devices.

    It is also not quite as simple as you propose, even in that snippet there is an error and ommissions:

    * Device ID is a 64bit number, but you're only reading 4 bytes
    * api.read() returns bytes, not an integer, whats the encoding? It's certainly not clear if you've ever looked at the Zephyr function that gets the hardware ID: https://github.com/zephyrproject-rtos/zephyr/blob/dcf42917c550714d2457947538b9e29d083e872e/drivers/hwinfo/hwinfo_nrf.c#L37-L38

    I say this not because I can't answer these questions myself, but to hopefully make the point that it would be nice if the tools could provide these values directly.

    And of course users have 0 idea of whether a given register has the same memory address across all parts of a family. If they come across a sample like yours, not integrated into the tool itself, they are still going to need to double check against a datasheet to see if its valid for their particular part.

Children
Related