Partition Manager: nRF54L15 OTP Memory Region Size Mismatch

Board: nRF54L15DK

NCS: v3.1.1

When I build an application for the nRF54L15 processor, the "otp" memory region in the auto generated "partitions.yml" file has a size of 0x4FC:

otp:
  address: 0xffd500
  end_address: 0xffd9fc
  region: otp
  size: 0x4fc

The real size of the OTP section is 0x500 (320 4-byte registers) "nrf54l15_types.h":

/* UICR_OTP: One time programmable memory */
  #define UICR_OTP_MaxCount (320UL)                  /*!< Max size of OTP[320] array.                                          */
  #define UICR_OTP_MaxIndex (319UL)                  /*!< Max index of OTP[320] array.                                         */
  #define UICR_OTP_MinIndex (0UL)                    /*!< Min index of OTP[320] array.                                         */

I tracked this autogenerated memory region to the "ncs/v3.1.1/nrf/cmake/sysbuild/partition_manager.cmake" file on lines 526 to 532:

    if(DEFINED ${image_name}_CONFIG_SOC_NRF54L15_CPUAPP
      OR DEFINED ${image_name}_CONFIG_SOC_NRF54L05_CPUAPP
      OR DEFINED ${image_name}_CONFIG_SOC_NRF54L10_CPUAPP
      )
      set(otp_start_addr "0xffd500")
      set(otp_size 1276)  # 319 * 4
    endif()

Is the last of the OPT registers reserved for something?  Why is there a size discrepancy?

Parents
  • Hello,

    I remember seeing this somewhere, but I couldn't find the source for it. It is correct that the OTP is a bit smaller than 0x500. But in fact, even more is reserved, if you intend to use NCS. Some of these are used by the bootloader. And although it doesn't say in the documentation.

    Perhaps you can elaborate a bit about how much of the OTP register you were planning on using, and I can find the internal ticket tomorrow stating how much is actually reserved for the customer, and how much that is reserved by NCS.

    Best regards,

    Edvin

  • Thank you for the quick reply!

    I was aware that the beginning portion of the OTP registers were reserved for the bootloader because I came across this ticket when I was doing research into the UICR peripheral and the use of OTP: 
    https://github.com/nrfconnect/sdk-nrf/pull/24686 

    I'd just like to use 2 of the registers, and I was planning on placing my data at the end of the OTP memory area to be safe, and that is when I discovered this discrepancy.

    So you're saying that placing data in the last OTP register is not supported since the OTP memory area is not actually 320 registers long?

    // Unsupported??
    NRF_UICR->OTP[UICR_OTP_MaxIndex] = 0x12345678;
    
    ... later ...
    
    uint32_t myCustomOTPValue = NRF_UICR->OTP[UICR_OTP_MaxIndex];
    

Reply
  • Thank you for the quick reply!

    I was aware that the beginning portion of the OTP registers were reserved for the bootloader because I came across this ticket when I was doing research into the UICR peripheral and the use of OTP: 
    https://github.com/nrfconnect/sdk-nrf/pull/24686 

    I'd just like to use 2 of the registers, and I was planning on placing my data at the end of the OTP memory area to be safe, and that is when I discovered this discrepancy.

    So you're saying that placing data in the last OTP register is not supported since the OTP memory area is not actually 320 registers long?

    // Unsupported??
    NRF_UICR->OTP[UICR_OTP_MaxIndex] = 0x12345678;
    
    ... later ...
    
    uint32_t myCustomOTPValue = NRF_UICR->OTP[UICR_OTP_MaxIndex];
    

Children
Related