cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo-G474RE I2C Debug Problems

LSanm.1
Associate II

Hello everyone, I am trying to make an I2C communication with the Nucleo G474RE, however I am having problems at the time of Debugging. This is causing that the SCL stops working on my board.

I use the I2C1 Pin 14 (PA14) and Pin 13 (PA13) in the initial configurations.

Then I try to check if the GPIO of Pins 14 and 15 performs any reaction through the HAL_GPIO Toggle_Pin() function, and I come to the conclusion that the SCL pin (Pin 14 /PA14) no longer reacts.

I understand that at the moment of doing the Debug these pins correspond to SYS_JTMS-SWDIO (PA13) and SYS_JTCK-SWCLK (PA14) so there is a conflict there.

How can I solve this problem? that would be the first question, the second one would be if my board is not working properly?

Thanks

0693W00000Y6quEQAR.png

6 REPLIES 6

Lacking much detail

Perhaps instrument the software side.

Use a scope or logic analyzer on the hardware side.

Read the documentation for the parts you're using.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
LSanm.1
Associate II

Hi, I used an oscilloscope with I2C decoder to know if the data transfer was correct, but no SCL signal is obtained.

S.Ma
Principal

Usually the debug pins with swdio and swdclk are mandatory for performing debug. They are activated by default amd other use kills debug when sw overrides them properly.

I2C should have other alternative set of pins on this package. Override swd bus pins at the end of your development.... once all set.

LSanm.1
Associate II

Thank you very much for your reply. My other question would be, if it is possible that my board was damaged? because of the bad execution of Debug having used these pins SWDIO and SWDCLK initially as I2C1, because I have noticed through Scope that the SDA signal is no longer visible to any alternate I2C that the Board has. For example for I2C2.

I have made a simple program to know if the GPIOs are working correctly using the HAL_GPIO_TogglePin() function, and I have noticed that some GPIOs are not reacting correctly, for example PF0 (SDA I2C2) does not give any Output.

Is there any way to save this board? or to make it work normally again?

S.Ma
Principal

Can you use the onboard stlink to program the chip ? If not, maybe the builtin user code kills swd function, so you will need to change the boot pin level to not boot in user mode, then enter debug, then reflash with ok user code, then power cycle.... learn the boot pin usage.

You can add a 0.5sec delay when your codd start to give small time window for debugger to catch the train before it wrecks onto the boot pin way.

LSanm.1
Associate II

yes, the STLINK is available and im using this to debug the board.

i´ll try to reprogram without the boot pin.

I´ll give a feedback if it works.

Thank you.