Dw1000's init problem

When I initialized the chip dw1000, the initialization failed.
Is there a good way of checking .

THANKS

please provide more details:

HW ?
SW ?

steps to make issue happen…

I use the STM32C8T6 to controled the DW1000 via SPI interface。and use the “inittestapplication(uint8 s1switch)” to init the dw1000.but i don’t success.

[code]uint32 inittestapplication(uint8 s1switch)
{
uint32 devID ;
instanceConfig_t instConfig;
int result;

SPI_ConfigFastRate(SPI_BaudRatePrescaler_32);  //max SPI before PLLs configured is ~4M

//this is called here to wake up the device (i.e. if it was in sleep mode before the restart)
devID = instancereaddeviceid() ;
if(DWT_DEVICE_ID != devID) //if the read of device ID fails, the DW1000 could be asleep
{
    port_SPIx_clear_chip_select();  //CS low
    Sleep(1);   //200 us to wake up then waits 5ms for DW1000 XTAL to stabilise
    port_SPIx_set_chip_select();  //CS high
    Sleep(7);
    devID = instancereaddeviceid() ;
    // SPI not working or Unsupported Device ID
    if(DWT_DEVICE_ID != devID)
        return(-1) ;
    //clear the sleep bit - so that after the hard reset below the DW does not go into sleep
    dwt_softreset();
}

//reset the DW1000 by driving the RSTn line low
reset_DW1000();

result = instance_init() ;
if (0 > result) return(-1) ; // Some failure has occurred

SPI_ConfigFastRate(SPI_BaudRatePrescaler_4); //increase SPI to max
devID = instancereaddeviceid() ;

if (DWT_DEVICE_ID != devID)   // Means it is NOT DW1000 device
{
    // SPI not working or Unsupported Device ID
    return(-1) ;
}

if((s1switch & SWS1_ANC_MODE) == 0)
{
    instance_mode = TAG;
}
else
{
    instance_mode = ANCHOR;
}

addressconfigure(s1switch, instance_mode) ;                            // set up initial payload configuration

if((instance_mode == ANCHOR) && (instance_anchaddr > 0x3))
{
	instance_mode = LISTENER;
}

instancesetrole(instance_mode) ;     // Set this instance role

// get mode selection (index) this has 4 values see chConfig struct initialiser for details.
dr_mode = decarangingmode(s1switch);

chan = instConfig.channelNumber = chConfig[dr_mode].channel ;
instConfig.preambleCode = chConfig[dr_mode].preambleCode ;
instConfig.pulseRepFreq = chConfig[dr_mode].prf ;
instConfig.pacSize = chConfig[dr_mode].pacSize ;
instConfig.nsSFD = chConfig[dr_mode].nsSFD ;
instConfig.sfdTO = chConfig[dr_mode].sfdTO ;
instConfig.dataRate = chConfig[dr_mode].datarate ;
instConfig.preambleLen = chConfig[dr_mode].preambleLength ;

instance_config(&instConfig, &sfConfig[dr_mode]) ;                  // Set operating channel etc

return devID;

}[/code]

So you are using EVB1000 (EVK) code on your own HW?

Please have a look as APS022 Application Note (Debugging)

As a first step, you should power on the IC/micro, then configure/initialise micro’s SPI and then check SPI is working correctly, just by reading from register 0 - to check if you get 0xdeca0130.

If the SPI is working correctly, then move onto application…

Please also search the forum, there are a lot of other threads which discuss SPI configurations and issues, and how to resolve them.

Thank you very much :smiley: :smiley: