Learn MoreFAQsTutorials

7 posts / 0 new
Last post
lzerman
Offline
Last seen:1 month 8 hours ago
加入:2020-07-08 08:31
P0_2 Serial issues

We are able to use the P0_7/P0_6 defaults with the the UART sample program. But upon swithcing RX or TX to P0_2, we get nothing. Can P0_2 be used for RX or TX? Am I missing a non-obvious configuration? Thank you.

lzerman
Offline
Last seen:1 month 8 hours ago
加入:2020-07-08 08:31
I can not get P0_2 to act as

I can not get P0_2 to act as a standard digital output GPIO either.

PM_Dialog
Offline
Last seen:1 hour 17 sec ago
Staff
加入:2018-02-08 11:03
Hi lzerman,

Hi lzerman,

Since you are using the TINY module, the P0_2 and P0_10 are used for the Serial Wire Debug (SWD) Interface. If the SWD interface is not required, then P0_2 and P0_10 can be used as GPIO. You should also configure both of them in your software.

You should also remove the jumper from the JTAG position in the J1 header in case you are using the Pro-DK.

Then please also check if the P02_MODE_REG is configured properly.

Thanks, PM_Dialog

awilhite
Offline
Last seen:2 months 4 weeks ago
加入:2020-08-24 14:38
I'm having the same issue.

I'm having the same issue. After the application has booted, I would like to repurpose P0_2 and P0_10 as GPIO. I believe I have taken all of the necessary steps but am unable to drive either P0_2 or P0_10 high.

#define EN0_PORT GPIO_PORT_0 #define EN0_PIN GPIO_PIN_2 #define EN1_PORT GPIO_PORT_0 #define EN1_PIN GPIO_PIN_10 /* In set_pad_functions */ RESERVE_GPIO(EN0, EN0_PORT, EN0_PIN, OUTPUT); GPIO_ConfigurePin(EN0_PORT, EN0_PIN, OUTPUT, PID_GPIO, false); RESERVE_GPIO(EN1, EN1_PORT, EN1_PIN, OUTPUT); GPIO_ConfigurePin(EN1_PORT, EN1_PIN, OUTPUT, PID_GPIO, false); /* In main */ GPIO_SetActive(EN0_PORT, EN0_PIN); GPIO_SetActive(EN1_PORT, EN1_PIN);

Please see the above snippet of the configuration steps. Am I missing something?

lzerman
Offline
Last seen:1 month 8 hours ago
加入:2020-07-08 08:31
The semi-solution is to set

The semi-solution is to set the SYS_CTRL_REG[DEBUGGER_ENABLE] = 0;

8:7

R/W

DEBUGGER_ENAB LE

Enable the debugger. This bit is set by the booter according to the OTP header. If not set, the SWDIO and SW_CLK can be used as gpio ports.

0x0: no debugger enabled.
0x1: SW_CLK = P0[2], SW_DIO=P0[5] 0x2: SW_CLK = P0[2], SW_DIO=P0[1] 0x3: SW_CLK = P0[2], SW_DIO=P0[10]

WARNING!!! Setting that bit will make the chip no longer programmable via JTAG!!! It appears like it “Bricks” the chip. In reality you can still program via UART. To un-brick the chip I wrote a batch file to restore stuff back to normal, so it works with JTAG again, but you lose the use of P0_2 again. We are going to redesign our custom boars not to use the P0_2 in that way. I wish this was documented somewhere and not killing houses of developers (mine and your) time.

@c:\diasemi\smartsnippetsStudio2.0.14\Toolbox\SmartSnippetsToolbox.exe -type booter -chip DA14531 -com_port 6 -uart P0_5 -file "C:\Users\Leona\Documents\DA145xx_SDK\6.0.14.1114\config\toolbox_resources\DA1453x\common\flash_programmer.bin"

THIS KILLED HOURS OF OUR TIME!!!

awilhite
Offline
Last seen:2 months 4 weeks ago
加入:2020-08-24 14:38
Thanks for the explanation,

Thanks for the explanation, Izerman. Would you mind sharing your batch file? That may prove to be a valuable resource to others who face the same situation.

lzerman
Offline
Last seen:1 month 8 hours ago
加入:2020-07-08 08:31
The commandline at the bottom

The commandline at the bottom of my post is the batch file. It is a one-liner.