This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52840 Errata 187 for SDK 15.0.0

Hello:

I am working on a USB bootloader project.  I am running into the issue where the USB will not boot on first start up but boots following this.  I read some of the previous comments on the issue. On thing I am seeing:  The code below does not return True for our implementation. It would fix the issue if did return True. This is the Errata 187 detection code.

static inline bool nrf_drv_usbd_errata_type_52840_fp1(void) {

   return ( nrf_drv_usbd_errata_type_52840() &&
    ( ((*(uint32_t *)0xF0000FE8) & 0xF0) == 0x20 ) &&    /// use to be 0x10
    ( ((*(uint32_t *)0xF0000FEC) & 0xF0) == 0x00 ) );

}

I am seeing the value 0x30 returned from register 0xF000_0FE8 (instead of 0x10 or 0x20).  Is it ok to patch the  nrf_drv_usbd_errata_type_52840_fp1() function with 0x30 instead of 0x20?


Thanks,

joer55

Parents
  • Hi Joe

    What you are seeing is an issue in the errata file, where future revisions default to not implementing any workarounds. 

    In later SDK versions this is changed, and a function called nrf_errata_xxx will be called instead, to verify which workarounds should be applied or not.

    For reference here is the implementation for errata 187:

    static bool nrf52_errata_187(void)
    {
        #ifndef NRF52_SERIES
            return false;
        #else
            #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
             || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
             || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
                uint32_t var1 = *(uint32_t *)0x10000130ul;
                uint32_t var2 = *(uint32_t *)0x10000134ul;
            #endif
            #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
                if (var1 == 0x08)
                {
                    switch(var2)
                    {
                        case 0x00ul:
                            return false;
                        case 0x01ul:
                            return true;
                        case 0x02ul:
                            return true;
                        case 0x03ul:
                            return true;
                    }
                }
            #endif
            #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
                if (var1 == 0x0D)
                {
                    switch(var2)
                    {
                        case 0x00ul:
                            return true;
                        case 0x01ul:
                            return true;
                    }
                }
            #endif
            #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
                if (var1 == 0x10)
                {
                    switch(var2)
                    {
                        case 0x00ul:
                            return true;
                        case 0x01ul:
                            return true;
                        case 0x02ul:
                            return true;
                    }
                }
            #endif
            return false;
        #endif
    }

    As a quick fix you can change the code to ensure that errata 187 is applied to your device, yes. 

    Best regards
    Torbjørn

Reply
  • Hi Joe

    What you are seeing is an issue in the errata file, where future revisions default to not implementing any workarounds. 

    In later SDK versions this is changed, and a function called nrf_errata_xxx will be called instead, to verify which workarounds should be applied or not.

    For reference here is the implementation for errata 187:

    static bool nrf52_errata_187(void)
    {
        #ifndef NRF52_SERIES
            return false;
        #else
            #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
             || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
             || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
                uint32_t var1 = *(uint32_t *)0x10000130ul;
                uint32_t var2 = *(uint32_t *)0x10000134ul;
            #endif
            #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
                if (var1 == 0x08)
                {
                    switch(var2)
                    {
                        case 0x00ul:
                            return false;
                        case 0x01ul:
                            return true;
                        case 0x02ul:
                            return true;
                        case 0x03ul:
                            return true;
                    }
                }
            #endif
            #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
                if (var1 == 0x0D)
                {
                    switch(var2)
                    {
                        case 0x00ul:
                            return true;
                        case 0x01ul:
                            return true;
                    }
                }
            #endif
            #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
                if (var1 == 0x10)
                {
                    switch(var2)
                    {
                        case 0x00ul:
                            return true;
                        case 0x01ul:
                            return true;
                        case 0x02ul:
                            return true;
                    }
                }
            #endif
            return false;
        #endif
    }

    As a quick fix you can change the code to ensure that errata 187 is applied to your device, yes. 

    Best regards
    Torbjørn

Children
Related