Just getting started w/STM32

Apple Mac OSX
Post Reply
arm_fred
Posts: 3
Joined: Sat Jun 18, 2016 8:25 pm

Just getting started w/STM32

Post by arm_fred » Sat Jun 18, 2016 8:39 pm

And I'm having problems. Gee, something you've not heard of before, right? :o

Background: Running OSX El Capitan. Have 1.6.9 IDE installed with the STM32 helper files. I can compile okay but cannot download. I'm using a blue pill with the two jumpers, Boot0 is on, 1 is off. The board is connected correctly through an FTDI module which appears in the IDE and I can see it communicate and return transmitted characters to the board via CoolTerm. But, when I try to download, I get this:

Error probing interface "serial_posix"
Cannot handle device "/dev/cu.usbserial-A50285BI"
Failed to open port: /dev/cu.usbserial-A50285BI
stm32flash Arduino_STM32_0.9

http://github.com/rogerclarkmelbourne/arduino_stm32

Using Parser : Raw BINARY

the selected serial port
does not exist or your board is not connected


Any ideas of what I should do? I'm quite lost at this point...

User avatar
RogerClark
Posts: 7459
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Just getting started w/STM32

Post by RogerClark » Sat Jun 18, 2016 10:20 pm

please read the previous post in this thread

viewtopic.php?f=21&t=1182

User avatar
mrburnette
Posts: 1883
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Just getting started w/STM32

Post by mrburnette » Sat Jun 18, 2016 10:22 pm

... now you know why the forum recommends "Maple Mini" as yourfirst STM32duino board.

But,
Welcome to the forum. STM32duino.com is fully Google bot indexed;
Try this search ... the second set of results may be helpful.

Ray

arm_fred
Posts: 3
Joined: Sat Jun 18, 2016 8:25 pm

Re: Just getting started w/STM32

Post by arm_fred » Sun Jun 19, 2016 4:08 am

Thank you for the links.

I was able to determine that the source files (for the flasher program) downloaded from Roger's area on GitHub had the parity patches applied but - I am unable to verify if the binaries were ever rebuilt. Further, I am unable to rebuild myself as I'm a Mac noob and quite new to the whole open source scene. Not sure if the GCC compiler is on my machine.

I did try another USB->serial convertor, a CH340G that I know works for Arduino mini's. But, it looks like a similar problem as the response is:

Failed to init device.
stm32flash Arduino_STM32_0.9

http://github.com/rogerclarkmelbourne/arduino_stm32

Using Parser : Raw BINARY
Interface serial_posix: 230400 8E1


So I'm no further along in the process. I'm open to any and all suggestions!

BTW, I do have several Maple Mini clones (the Baite version) as well as a couple Iteadmaple 1.0's. I cannot get either one to create a serial port when I plug in the USB cable to the Mac which is why I ended up stuck on the blue pill version. If the learned among us think I would do better to trouble shoot the Maple Mini, just say so, I'd just like to see at least one board programmed for my weekend effort!

jcu
Posts: 4
Joined: Fri Jun 17, 2016 1:18 pm

Re: Just getting started w/STM32

Post by jcu » Sun Jun 19, 2016 3:21 pm

@arm_fred
I am new to the forum and to the STM32.

To go beyond the"open device" issue, you need to:
- modify serial_posix.c in the subfolder tools/macosx/src/stm32flash_serial/src
- insert the port parity check statement at line 179 as mentioned in the post viewtopic.php?f=21&t=1182
- build a new stm32flash binary with "make"
- move it under the subfolder tools/macosx/stm32flash, overwriting the current version

BTW, I flashed the stm32duino bootloader to upload with USB, but under macOS version 10.11.5, it has hard time opening the DFU device:

Code: Select all

dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Deducing device DFU version from functional descriptor length
dfu-util: No DFU capable USB device available
After a few reset button pushes, it does sync up and upload.
However, every new upload will display the annoying "A new network interface has been detected".
I haven't got the chance to dig more into this issue.

Yet another hint: the sketch I am trying to port to STM32F1 uses 22,232 bytes in AVR and 87,904 bytes in STM32F1, four times bigger. There are posts in the forum about this (staying away from libc libraries) but I haven't figure out yet how to actually trim the code.
Good luck

User avatar
mrburnette
Posts: 1883
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Just getting started w/STM32

Post by mrburnette » Sun Jun 19, 2016 4:06 pm

jcu wrote: <...>
Yet another hint: the sketch I am trying to port to STM32F1 uses 22,232 bytes in AVR and 87,904 bytes in STM32F1, four times bigger. There are posts in the forum about this (staying away from libc libraries) but I haven't figure out yet how to actually trim the code.
Good luck
The "growth" in fkash from 8-bit to 32-bit is normal. All of the Maple Mini clones have 128K flash although only 64 is officically stated in the Ref. Doc.

You can force constant string variables into flash with the "F" macro and the compiler will optimize 32-bit code differently than with AVR. When porting sketches, an Int in AVR is 16-bit but an Int in STM32 is 32-bit. Remember, the linker sticks all variables into Flash and then non-constants are initialized into SRAM during the C initialization sequence.

8-bit vs 32-bit Arduino:
It is the same thing, but different.

Ray

User avatar
martinayotte
Posts: 1229
Joined: Mon Apr 27, 2015 1:45 pm

Re: Just getting started w/STM32

Post by martinayotte » Sun Jun 19, 2016 5:30 pm

22,232 bytes in AVR and 87,904 bytes in STM32F1, four times bigger
Yes, it is probably that you bring too much from libc. For example, are you using some printf with floats ?
You can provide links to code you are trying to port, maybe we can help figure out.

arm_fred
Posts: 3
Joined: Sat Jun 18, 2016 8:25 pm

Re: Just getting started w/STM32

Post by arm_fred » Sun Jun 19, 2016 9:02 pm

Binary rebuilt and I am now able to program the blue pills with the FTDI232 interface. I think the CH340G is unreliable at 230k, the FTDI appears to be 100% solid with no failed download attempts. Now that I've done the deep dive into the STM32flash_serial, I'll play a bit and knock the baud rate down to 115200 and see if the CH340G is more reliable there.

Thank you to all for you help! I could not have done it without you.

Post Reply