Program does not work on the custom board, but works on development board

2 posts / 0 new
Last post
wenkangl
Offline
Last seen:4 years 3 months ago
加入:2016-06-23 13:01
Program does not work on the custom board, but works on development board

Hi, Dialog

We developed the firmware based on the "ble_app_peripheral" example, and our custom designed board contains a MPU6500 accelerometer.
When we bypass the DA14580 on our custom designed board and connect the accelerometer with the development board, the firmware works well.
but when we connect the DA14580 on our custom designed board with the accelerometer, the firmware ends up with hard fault. it seems the hard fault occurs when SetBits16(SYS_CTRL_REG, PAD_LATCH_EN, 1); is being executed....
the pin configuration for our project is as follows, we have commented out all the uart pin configurations, since we don't not use such interface..
/****************************************************************************************/
/* i2c eeprom configuration */
/****************************************************************************************/

#define I2C_EEPROM_SIZE 0x20000 // EEPROM size in bytes
#define I2C_EEPROM_PAGE 256 // EEPROM's page size in bytes
#define I2C_SPEED_MODE I2C_FAST // 1: standard mode (100 kbits/s), 2: fast mode (400 kbits/s)
#define I2C_ADDRESS_MODE I2C_7BIT_ADDR // 0: 7-bit addressing, 1: 10-bit addressing
#define I2C_ADDRESS_SIZE I2C_2BYTES_ADDR // 0: 8-bit memory address, 1: 16-bit memory address, 3: 24-bit memory address

/**/
/****************************************************************************************/
/* SPI FLASH configuration */
/****************************************************************************************/
#define SPI_FLASH_DEFAULT_SIZE 131072 // SPI Flash memory size in bytes
#define SPI_FLASH_DEFAULT_PAGE 256
#define SPI_SECTOR_SIZE 4096

#define SPI_EN_GPIO_PORT GPIO_PORT_0
#define SPI_EN_GPIO_PIN GPIO_PIN_6

#define SPI_CLK_GPIO_PORT GPIO_PORT_0
#define SPI_CLK_GPIO_PIN GPIO_PIN_0

#define SPI_DO_GPIO_PORT GPIO_PORT_0
#define SPI_DO_GPIO_PIN GPIO_PIN_5

#define SPI_DI_GPIO_PORT GPIO_PORT_0
#define SPI_DI_GPIO_PIN GPIO_PIN_3

/****************************************************************************************/
/* LED configuration */
/****************************************************************************************/
#define GPIO_ALERT_LED_PORT GPIO_PORT_1
#define GPIO_ALERT_LED_PIN GPIO_PIN_1

and reserve & configurate:

RESERVE_GPIO( ALERT_LED, GPIO_ALERT_LED_PORT, GPIO_ALERT_LED_PIN, PID_GPIO);
RESERVE_GPIO( SPI_DI, SPI_DI_GPIO_PORT, SPI_DI_GPIO_PIN, PID_SPI_DI);
RESERVE_GPIO( SPI_DO, SPI_DO_GPIO_PORT, SPI_DO_GPIO_PIN, PID_SPI_DO);
RESERVE_GPIO( SPI_CLK, SPI_CLK_GPIO_PORT, SPI_CLK_GPIO_PIN, PID_SPI_CLK);
RESERVE_GPIO( SPI_EN, SPI_EN_GPIO_PORT, SPI_EN_GPIO_PIN, PID_SPI_EN);

GPIO_ConfigurePin(SPI_EN_GPIO_PORT, SPI_EN_GPIO_PIN, OUTPUT, PID_SPI_EN, true);
GPIO_ConfigurePin (SPI_CLK_GPIO_PORT SPI_CLK_GPIO_PIN, OUTPUT, PID_SPI_CLK, false);
GPIO_ConfigurePin(SPI_DO_GPIO_PORT, SPI_DO_GPIO_PIN, OUTPUT, PID_SPI_DO, false);
GPIO_ConfigurePin(SPI_DI_GPIO_PORT, SPI_DI_GPIO_PIN, INPUT_PULLUP, PID_SPI_DI, false);

we didn't see any faults in the hardware design, it is a simple SPI connection. Is the SDK is designed to work only with the development board? or it could work with custom designed board and the user only need to change the pin configuration in user_periph_setup.c and user_periph_setup.h? or else....

Thank you!

Device:
MT_dialog
Offline
Last seen:1 month 1 day ago
Staff
加入:2015-06-08 11:34
Hi wenkangl,

Hi wenkangl,

No, the SDK isn't designed to work only with the developement kits, it would be meaningless to design an entire SDK in order to work only with the development kit. The user has to setup the configuration of his pins to the user_periph_setup.h file. Of course there will be differences between the dev kit and the custom board, for example if you are running in buck mode and you omit the XTAL32 in order your LP clock to be from the RCX you will have to check that in the SDK. Most probably your issue is a HW problem on your PCB. If you dont set the pads to the configuration you want, (ommit the instruction that you suspect that it is creating the problem) can you check if the device is advertising or that it does whatever it is instructed ?

Thanks MT_dialog