0
\$\begingroup\$

I was using this code from github on a blue pill. Now I would like to adapt it for STM32F401 on a Nucleo-64 board. I tried changing the GPIO to A7 and attaching an led (which lit up when I attached it to 3.3v) to GPIO A7 but it dit not seem to work.

I think the problem might be in this step:

rcc_clock_setup_in_hse_8mhz_out_72mhz(); // Use this for "blue pill"

because afaik this is the only step specific to the blue pill.

The blue pill has an 8MHz oscillator and according to this, the Nucleo has a 32.768 kHz crystal oscillator.

Can someone please tell me how to modify this line?

I am using arm-none-eabi-gdb and make to upload code to Nucleo, as I was with blue pill.

TIA

\$\endgroup\$
  • 1
    \$\begingroup\$ "Nucleo 64" is just a PCB design that hosts a 64-pin STM part, it doesn't specify which one - what is critical here is that you have the STM32F401. You are mistaken on the oscillators, both parts have both low and high speed internal oscillator options, the nucleo may also give you an option to receive a clock from the debugger MCU instead of using an external crystal. \$\endgroup\$ – Chris Stratton Oct 11 '19 at 20:11
  • 1
    \$\begingroup\$ @ChrisStratton link points to F4 nucleo board. \$\endgroup\$ – 0___________ Oct 11 '19 at 20:37
  • 1
    \$\begingroup\$ You shouldn't have to click or hover a link to know what someone is even asking \$\endgroup\$ – Chris Stratton Oct 11 '19 at 22:40
1
\$\begingroup\$

You need to rewrite all of those functions as STM32F4 and STM32F1 have completely different clocks, different GPIOs . Changing GPIO pin is definitely not enough.+-

\$\endgroup\$
  • \$\begingroup\$ Where can I find this information? \$\endgroup\$ – Joey Gough Oct 11 '19 at 20:12
  • \$\begingroup\$ on thew stm website - search for your micro and download the reference manual. \$\endgroup\$ – 0___________ Oct 11 '19 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.