cancel
Showing results for 
Search instead for 
Did you mean: 

X-NUCLEO-SRC1M1 USB-PD Example can not be ported to custom boards

krbmr
Associate II

Hi there,

I am running a board simmilar to the X-NUCLEO-SRC1M1 but with a different pinout at the MCU. More detailed, my ISense and VSense Pins are connected to ADC9 and ADC10 instead of ADC0 and ADC15.

The example works with the nucleo Board just fine.

I changed the VSENSE_ADC_CHANNEL definitions in the src1m1_conf.h to my respective values to port to my board.
The code generated however still measures on ADC0 and thus does start the charging process but will terminate immediately, because it senses 0V at the connector and something must be wrong. I verified it is measuring at ADC0 by applying known voltages to that pin and checking the ADC output variables.

I tried manually starting the ADC with DMA but with little sucess.
I also tried manually going through the code to find out where the definition might be skipped but did not find anything.

Could it be that there is a bug in the code and it fails to set up the pins properly but the example "accidentally" works, because voltage is routed to ADC 0 anyways?

Any ideas? Thanks,

Jakob

 

3 REPLIES 3
Issamos
Lead II

Hello @krbmr 

Have you verified that your ADCs are well activated, clocked and gpio well configured for the pinout modifications.

Best regards.

II

 

Nicolas P.
ST Employee

Hello @krbmr,

could you share the ADC initialisation structures to check ? (HAL_ADC_Init, and HAL_ADC_ConfigChannel)

thanks

Nicolas

krbmr
Associate II

Hi all,

thanks for the quick response.

Looks like I got it figured out. The changes in the config file did indeed work and changed the pins to the requested pins, so all-good. The Values in the DMA Buffer did not make sense to me when debugging, but as it works, I assume it is ok this way.

Again, thanks for your support.

Jakob