Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

STM32 / Cortex-M3 development environment on FreeBSD?

622 views
Skip to first unread message

Torfinn Ingolfsen

unread,
Aug 18, 2013, 9:31:32 AM8/18/13
to
Is anyone using FreeBSD as the platform / operating system for a STM32 /
Cortex-M3 development environment? Embedded, not trying to make FreeBSD
run on the target.
If so, is there a how-to / writeup anywhere?
The target is SKU 157301[1] from DX, if anyone wants to know.

References:
1)
http://dx.com/p/mini-stm32-stm32f103rbt6-development-board-w-2-8-tft-lcd-touch-screen-157301

--
Torfinn Ingolfsen,
Norway
Message has been deleted

Torfinn Ingolfsen

unread,
Aug 19, 2013, 3:31:22 PM8/19/13
to
On 08/19/2013 03:41 PM, hac...@yahoo.com wrote:
> I have one of those. There is some sort of communication program that you use through the usb port. But I wanted to try a different OS on it, say FreeRTOS. I bought an ST-LINK V2 JTAG programmer for this purpose.
>
> http://code.google.com/p/qstlink2/

Does all STM32 boards have the ST-Link? I thought that ST-Link was a
separate chip?
I also have a JTAG adapter (the GoodFET42[1]), I just need to figure out
if a cable from 14-pin to 20-pin JTAG will work, so perhaps OpenOCD[2]
will work for me.


> http://projectproto.blogspot.com/2010/04/freertos-on-mini-stm32.html
>
> I'm going to give this a try some time and report back on my success.

> I wanted to try to flash it with FreeRTOS, because I could not follow that Chinese program that was used with the default bootloader.
> No offense to the programmers who made this software. I just think FreeRTOS would be a better choice.

Well, I willbe happy to be able to just get any program loaded onto the
STM32 board as a first step. :-)


References:
1) http://goodfet.sourceforge.net/
2) http://openocd.sourceforge.net/


--
Torfinn Ingolfsen,
Norway
Message has been deleted

BobH

unread,
Aug 20, 2013, 7:42:07 PM8/20/13
to
On 8/19/2013 8:05 PM, hac...@yahoo.com wrote:
> On Monday, August 19, 2013 3:31:22 PM UTC-4, Torfinn Ingolfsen wrote:
>> On 08/19/2013 03:41 PM, hac...@yahoo.com wrote:
>
>> Does all STM32 boards have the ST-Link? I thought that ST-Link was a
>> separate chip?
>
> No, it's not built-in. It's a seperate device.
>
> http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168
>
>
>>
>> I also have a JTAG adapter (the GoodFET42[1]), I just need to figure out
>> if a cable from 14-pin to 20-pin JTAG will work, so perhaps OpenOCD[2]
>> will work for me.
>
> OK, that's good advice. I'll try the OpenOCD port. I bought this ST-LINK
> programmer seperate from the board. I figured it was the best choice, since
> it's made by STM Micro. Other JTAG programmers should world, though.
>
>
>> Well, I willbe happy to be able to just get any program loaded onto the
>> STM32 board as a first step. :-)
>
>
> LOL, same here. There was a special program written for this evaluation
> board that I found to be too hard to understand. It was too obstruse
> (the language was Chinese), so I gave up. But if I could load a different
> OS on this board, maybe that will make things easier.

I have played with the STM Discovery board using openocd enough to
verify that it would talk to the board. It certainly recognized the
board. I was running a Linux box, but I don't remember any wierd
requirements to build openocd.

Here are a few sites I marked when I was doing this. They are not in any
particular order of usefulness.

https://launchpad.net/gcc-arm-embedded

http://sourceforge.net/projects/gnuarmeclipse/?source=recommended

http://www.alexwhittemore.com/open-source-ide-and-toolchain-for-the-stm32f4-discovery-on-mac-osx-lion/

https://sites.google.com/site/stm32discovery/open-source-development-with-the-stm32-discovery/setting-up-eclipse-for-stm32-discovery-development

http://dangerousprototypes.com/2011/01/27/stm32-discovery-getting-started-guide/


Torfinn Ingolfsen

unread,
Aug 22, 2013, 4:38:39 PM8/22/13
to
On 08/20/2013 05:05, hac...@yahoo.com wrote:
> On Monday, August 19, 2013 3:31:22 PM UTC-4, Torfinn Ingolfsen wrote:
>> On 08/19/2013 03:41 PM, hac...@yahoo.com wrote:
>
>> Does all STM32 boards have the ST-Link? I thought that ST-Link was a
>>
>> separate chip?
>
> No, it's not built-in. It's a seperate device.
>
> http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168

Ah, ok.
I'm trying to use stm32flash[1] on FreeBSD to load / boot the stm32
board via USART boot. FWIW, stm32flash works nicely on Linux.
It compiles (use gmake instead of make) with a few warnings, and the
resulting binary actually runs:
tingo@kg-core1$ ./stm32flash
stm32flash - http://stm32flash.googlecode.com/

ERROR: Device not specified
Usage: ./stm32flash [-bvngfhc] [-[rw] filename] /dev/ttyS0
-b rate Baud rate (default 57600)
-r filename Read flash to file
-w filename Write flash to file
-u Disable the flash write-protection
-e n Only erase n pages before writing the flash
-v Verify writes
-n count Retry failed writes up to count times (default 10)
-g address Start execution at specified address (0 = flash start)
-f Force binary parser
-h Show this help
-c Resume the connection (don't send initial INIT)
*Baud rate must be kept the same as the first init*
This is useful if the reset fails
(output snipped in the interest of brevity)

But if I try to use it to read the board (which is attached as cuaU0 /
ttyU0):

tingo@kg-core1$ ll /dev/cuaU* /dev/ttyU*
crw-rw---- 1 uucp dialer - 0, 159 Aug 18 17:26 /dev/cuaU0
crw-rw---- 1 uucp dialer - 0, 160 Aug 18 17:26 /dev/cuaU0.init
crw-rw---- 1 uucp dialer - 0, 161 Aug 18 17:26 /dev/cuaU0.lock
crw------- 1 root wheel - 0, 156 Aug 18 17:26 /dev/ttyU0
crw------- 1 root wheel - 0, 157 Aug 18 17:26 /dev/ttyU0.init
crw------- 1 root wheel - 0, 158 Aug 18 17:26 /dev/ttyU0.lock
tingo@kg-core1$ su
Password:
root@kg-core1# ./stm32flash /dev/ttyU0
stm32flash - http://stm32flash.googlecode.com/

/dev/ttyU0: No such file or directory
root@kg-core1# ./stm32flash /dev/cuaU0
stm32flash - http://stm32flash.googlecode.com/

/dev/cuaU0: No such file or directory

I haven't figured out what the problem is. :-/

References:
1) http://code.google.com/p/stm32flash/

--
Torfinn Ingolfsen,
Norway
0 new messages