DEVEBOX STM32F407 mini

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
OutoftheBOTS_
Posts: 642
Joined: Mon Nov 20, 2017 10:18 am

DEVEBOX STM32F407 mini

Post by OutoftheBOTS_ » Wed Jul 17, 2019 7:48 am

From the other thread

I am trying to build the firmware for the STM32F407VGT6 but am getting the following build error

Code: Select all

LINK build-MCUDEV_DEVEBOX_F407VGT6/firmware.elf
build-MCUDEV_DEVEBOX_F407VGT6/main.o: In function `stm32_main':
main.c:(.text.stm32_main+0x2d0): undefined reference to `_sstack'
build-MCUDEV_DEVEBOX_F407VGT6/stm32_it.o: In function `HardFault_C_Handler':
stm32_it.c:(.text.HardFault_C_Handler+0x13c): undefined reference to `_sstack'
build-MCUDEV_DEVEBOX_F407VGT6/modmachine.o: In function `machine_info':
modmachine.c:(.text.machine_info+0x1b8): undefined reference to `_sstack'
Makefile:537: recipe for target 'build-MCUDEV_DEVEBOX_F407VGT6/firmware.elf' failed
make: *** [build-MCUDEV_DEVEBOX_F407VGT6/firmware.elf] Error 1

User avatar
jimmo
Posts: 547
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: DEVEBOX STM32F407 mini

Post by jimmo » Wed Jul 17, 2019 8:09 am

I'm assuming this is an out-of-tree board definition?

See https://github.com/micropython/micropyt ... ebb45488f1

OutoftheBOTS_
Posts: 642
Joined: Mon Nov 20, 2017 10:18 am

Re: DEVEBOX STM32F407 mini

Post by OutoftheBOTS_ » Wed Jul 17, 2019 8:19 am

I am using mcauser definition on a STM32F407VG MCU here is his definitions https://github.com/mcauser/MCUDEV_DEVEBOX_F407VGT6

Where is _sstack usually definded??

Should I just add _sstack = _estack - 16K; to stm32f407vg.ld ??

OutoftheBOTS_
Posts: 642
Joined: Mon Nov 20, 2017 10:18 am

Re: DEVEBOX STM32F407 mini

Post by OutoftheBOTS_ » Wed Jul 17, 2019 8:58 am

OutoftheBOTS_ wrote:
Wed Jul 17, 2019 8:19 am
I am using mcauser definition on a STM32F407VG MCU here is his definitions https://github.com/mcauser/MCUDEV_DEVEBOX_F407VGT6

Where is _sstack usually definded??

Should I just add _sstack = _estack - 16K; to stm32f407vg.ld ??
OK adding that line allowed it to build all the way create the dfu and hex file but now when I try to deploy I get this error

Code: Select all

pydfu.py line 21
import usb.core
Import error: No module namedn'usb'

User avatar
jimmo
Posts: 547
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: DEVEBOX STM32F407 mini

Post by jimmo » Wed Jul 17, 2019 9:04 am

Sounds like you need to install pyusb?

User avatar
jimmo
Posts: 547
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: DEVEBOX STM32F407 mini

Post by jimmo » Wed Jul 17, 2019 9:06 am

If this was working before (like a few months ago) then you possibly had pyusb installed for python2, but now the MicroPython makefiles use python3 by default.

OutoftheBOTS_
Posts: 642
Joined: Mon Nov 20, 2017 10:18 am

Re: DEVEBOX STM32F407 mini

Post by OutoftheBOTS_ » Wed Jul 17, 2019 9:11 am

This fixed it

Code: Select all

sudo apt install python3-usb

OutoftheBOTS_
Posts: 642
Joined: Mon Nov 20, 2017 10:18 am

Re: DEVEBOX STM32F407 mini

Post by OutoftheBOTS_ » Wed Jul 17, 2019 9:37 am

Ok when I deploy it appears to flash the firmware although aftre flashing is finished then it gives errors see output but after I unplug and remove the boot jumper then plug it back in neither linux or windows will see it on the usb like the firmware isn't talking at all

Code: Select all

Writing build-MCUDEV_DEVEBOX_F407VGT6/firmware.dfu to the board
File: build-MCUDEV_DEVEBOX_F407VGT6/firmware.dfu
    b'DfuSe' v1, image size: 334261, targets: 1
    b'Target' 0, alt setting: 0, name: "ST...", size: 333976, elements: 2
      0, address: 0x08000000, size: 14992
      1, address: 0x08020000, size: 318968
    usb: 0483:df11, device: 0x0000, dfu: 0x011a, b'UFD', 16, 0x2caa1564
Writing memory...
0x08000000   14992 [=========================] 100% 
0x08020000  318968 [=========================] 100% 
Exiting DFU...
Exception ignored in: <bound method Device.__del__ of <DEVICE ID 0483:df11 on Bus 003 Address 005>>
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/usb/core.py", line 1029, in __del__
  File "/usr/lib/python3/dist-packages/usb/core.py", line 225, in dispose
  File "/usr/lib/python3/dist-packages/usb/core.py", line 222, in release_all_interfaces
  File "/usr/lib/python3/dist-packages/usb/core.py", line 159, in managed_release_interface
  File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 751, in release_interface
  File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 552, in _check
usb.core.USBError: [Errno 19] No such device (it may have been disconnected)


OutoftheBOTS_
Posts: 642
Joined: Mon Nov 20, 2017 10:18 am

Re: DEVEBOX STM32F407 mini

Post by OutoftheBOTS_ » Thu Jul 18, 2019 4:32 am

It is definitely a problem with the boards definitions.

The board that I am using is a MCUDEV_DEVEBOX that has a STM32F407VGT6 MCU.

IF I compile the STM32F407VET6 definitions here https://github.com/mcauser/BLACK_F407VE it will compile and deploy then show up as PYBFLASH

If I compile the STM32F407ZGT6 definitions here https://github.com/mcauser/BLACK_F407ZG it will compile and deploy then show up as PYBFLASH

But I can't get the STM32F407VGT6 definition here https://github.com/mcauser/MCUDEV_DEVEBOX_F407VGT6 to work.

I suppose that I need to compare the 2 board definitions that are working and very similar to the MCU that I want to use and try to create my own board definition

Post Reply