SCL and SWCLK Problem in DA14531

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at https://www.dialog-semiconductor.com/support . We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
ozgurkoc
Offline
Last seen: 1 year 3 months ago
Joined: 2021-02-08 11:38
SCL and SWCLK Problem in DA14531

I have a DA14531-00FXDEVKT-U (Development Kit-USB) and a ADXL345 accelerometer. I want to do the "Reading I2C Accelerometer BLE" example. But P0_2 pin is connected to both SCL and SWCLK. I get an error "__BKPT(0);" while debugging the code. Can you help me?

Thank you in advance.

Device: 
PM_Dialog
Offline
Last seen: 6 months 3 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi ozgurkoc,

Hi ozgurkoc,

Thanks for your question online and for your interest in our BLE solution. The DA14531-DA14585-586 Reading I2C Accelerometer BLE is using the P03 for the ADXL345_SCL and the P01 for the ADXL345_SDA – see user_ADXL345.h file.

So, did you change the pin configuration for the ADXL345_SCL from P03 to P02?

The DA14531 is using the P02 for the SWCLK. It is possible to remap the SWD to different GPIOs.

The SWD signal mapping is defined by SYS_CTRL_REG[DEBUGGER_ENABLE] bitfield. Set this bitfield to :

  • 0x0 to disable the debugger
  • 0x1 to configure the SW_CLK and SW_DIO to P0_2 and P0_5 accordingly ( default option for WLCSP17 package)
  • 0x2 to configure the SW_CLK and SW_DIO to P0_2 and P0_1 accordingly
  • 0x3 to configure the SW_CLK and SW_DIO to P0_2 and P0_10 accordingly (default option for FCGQFN24 package). This option is not available in WLCSP17 package

However, the SW_CLK is always mapped to P0_2 as you can see.

There are two possible solutions for this issue:

  1. Configure the ADXL345_SCL to any of the available pins ( for example P03 as default ) and use the P02 as SWCLK.
  2. If you would like to use the ADXL345_SCL on P02, then the JTAG should be disabled - set SYS_CTRL_REG[DEBUGGER_ENABLE] bitfield to 0 – and configure the P02 as I2C SCL pin. By this way, you will not be able to debug your project via JTAG.

In which file the “__BKPT(0);” hits?

Thanks, PM_Dialog

ozgurkoc
Offline
Last seen: 1 year 3 months ago
Joined: 2021-02-08 11:38
Thank you PM_Dialog for your

Thank you PM_Dialog for your quick reply. I configured the ADXL345_SCL to any of the available pins ( for example P03 as default ) and used the P02 as SWCLK. It worked.

PM_Dialog
Offline
Last seen: 6 months 3 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi ozgurkoc,

Hi ozgurkoc,

Thanks for accepting my answer and glad that you got it working. If you have any other follow-up question, please raise a new forum post.

Thanks, PM_Dialog