Author Topic: Programming STM32 Nucleo from Linux  (Read 11326 times)

0 Members and 1 Guest are viewing this topic.

Offline 1994timmehTopic starter

  • Contributor
  • Posts: 13
  • Country: au
    • timhadwen.com
Programming STM32 Nucleo from Linux
« on: February 16, 2015, 08:38:26 am »
Hi,
Ive been working at this goal for a while now so i thought id open it up and see if anyone has a solution to my problem.

I bought a STM Nucleo F401RE and yes it has MBED, but for University and offline stuff its pretty darn useless. I have programmed a Netduino from linux but can't seem to find how to get this board to work.

Any ideas?

Cheers
Electrical and Computer Engineering Student at the University of Queensland, Brisbane, Australia!
 

Offline ealex

  • Frequent Contributor
  • **
  • Posts: 318
  • Country: ro
Re: Programming STM32 Nucleo from Linux
« Reply #1 on: February 16, 2015, 10:30:24 am »
My environment for working with microcontrollers in linux:

eclipse + CDT
CodeSourcery arm toolchain + PATH modified to point to the tool-chain's bin
openocd - latest version when i remember to update

i have a nucleo f401 board and it works properly - writing the flash and debugging via openocd, etc

what did you tried - and what / how did it fail ?
 

Online gmb42

  • Frequent Contributor
  • **
  • Posts: 299
  • Country: gb
Re: Programming STM32 Nucleo from Linux
« Reply #2 on: February 16, 2015, 10:52:26 am »
I take it you have looked at the Offline wiki page as it shows how you can easily export an mbed project to makefiles and then simply run make.  This should be enough to get you started.

You'll also have to install an ARM toolchain, e.g GCC ARM Embedded or Code Sourcery and OpenOCD.
« Last Edit: February 16, 2015, 10:56:16 am by gmb42 »
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Programming STM32 Nucleo from Linux
« Reply #3 on: February 16, 2015, 11:39:34 am »
Quote
but for University and offline stuff its pretty darn useless.

How so?

I have one programmed from keil/iar no problem. That's as offline as offline can go.
================================
https://dannyelectronics.wordpress.com/
 

Offline 1994timmehTopic starter

  • Contributor
  • Posts: 13
  • Country: au
    • timhadwen.com
Re: Programming STM32 Nucleo from Linux
« Reply #4 on: February 16, 2015, 12:01:20 pm »
I have been trying to go from scratch but Ecipse does seem like a nice way to go!

Anyway my problem seems to be flashing to the board. Im doing this through st-utils and arm-none-eabi-gdb but when i go load i get "Load Failed".

Any ideas?
Electrical and Computer Engineering Student at the University of Queensland, Brisbane, Australia!
 

Offline 1994timmehTopic starter

  • Contributor
  • Posts: 13
  • Country: au
    • timhadwen.com
Re: Programming STM32 Nucleo from Linux
« Reply #5 on: February 16, 2015, 12:04:05 pm »
How so?

I have one programmed from keil/iar no problem. That's as offline as offline can go.

Essentially the university want us to do this stuff from as close to scratch as we can. And the IDEs cost hundreds upon thousands of dollars!
Electrical and Computer Engineering Student at the University of Queensland, Brisbane, Australia!
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Programming STM32 Nucleo from Linux
« Reply #6 on: February 16, 2015, 12:14:40 pm »
Quote
Essentially the university want us to do this stuff from as close to scratch as we can.

Then go from scratch.

But it has nothing to do with your inability to program it offline.

Quote
And the IDEs cost hundreds upon thousands of dollars!

Plenty of free IDEs too.
================================
https://dannyelectronics.wordpress.com/
 

Offline 1994timmehTopic starter

  • Contributor
  • Posts: 13
  • Country: au
    • timhadwen.com
Re: Programming STM32 Nucleo from Linux
« Reply #7 on: February 16, 2015, 12:17:00 pm »

But it has nothing to do with your inability to program it offline.


Exactly! This is what i came onto here to find out about! Ive been banging my head against the wall trying to work it out, though someone would have done the same before and could shed some light.
Electrical and Computer Engineering Student at the University of Queensland, Brisbane, Australia!
 

Offline ealex

  • Frequent Contributor
  • **
  • Posts: 318
  • Country: ro
Re: Programming STM32 Nucleo from Linux
« Reply #8 on: February 16, 2015, 01:13:18 pm »
i've never used st-utils, openocd works without any problem.
is you board detected ?
run "lsusb" with the board attached - what do you see ?
i have to run openocd with root access ( sudo openocd .... ) on my system - otherwise normal used account can not access the usb.

do you have any output from st-utils ? will it work if you try to just load a binary from command line - not via gdb
how do you connect gdb to st-utils ?
 

Offline farsi

  • Regular Contributor
  • *
  • Posts: 66
Re: Programming STM32 Nucleo from Linux
« Reply #9 on: February 21, 2015, 10:53:49 am »
the MUCCC presented a gnu c toolchain for arm with stlink flasher last week:

https://github.com/muccc/arm-workshop

maybe it helps
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf