2015-03-30 02:26 AM
Hello,
I try to make a demoboard with a STM32F4 controller but I have some problems: Which pins I need to use the stlink programmer from a nucleo board (swdio, swclk ,... )? I found in the datasheet, that some functions are connected to more than one pin how the usart1_tx. How I can select which pin should be used? On the nucleo I tried to turn on the led but with eclipse it doesn't turned on. When I used the online compiler the led turned on. I think the online compiler inits the microcontroller. I used this minimalistic code: RCC->AHB1ENR |= 1; //enable clock for port A GPIOA->MODER |= (1<<10); //port A as output GPIOA->ODR |= (1<<5); //Set pin 5 Is there something I forgot to init that it doesn't work? Thank you.2015-03-30 06:10 AM
The debug interface has pretty define pins, SWCLK, SWDIO, (SWO optional), NRST (strongly advised), GND, VCC (depending on what voltage, and how's supplying it)
To route USART1_TX to a specific pin you have to configure the AFR (pin muxing), if you use the standard library via GPIO_PinAFConfig()2015-03-31 07:27 AM
Thank you.
I would have an external supply so I need only GND? What is NRST? But are the registers just set at reset that I can start with that minimal code?2015-03-31 07:44 AM
NRST (NRESET), Negated Reset, the processor's reset pin, so the debugger can quickly gain control of the processor and stop it.
I believe the default register settings of the peripherals are defined in the Reference Manual. By the time it's reached your main() function, the CMSIS library should have already run SystemInit() in system_stm32f4xx.c