8000 STM32 Nucleo F4x1 boards support · Issue #989 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

STM32 Nucleo F4x1 boards support #989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nuraci opened this issue Nov 27, 2014 · 21 comments
Closed

STM32 Nucleo F4x1 boards support #989

nuraci opened this issue Nov 27, 2014 · 21 comments

Comments

@nuraci
Copy link
nuraci commented Nov 27, 2014

Hi all,

I'm trying to run (with lots of fun) MicroPython on the STM32F401RE, some things are already good, but there is still much work to do (obviously), the big challenge is, from my point of view, how the user can manage easily the internal file system...

Another little issue is related to the build system as the "Nucleo" approach uses almost the same "stmhal" source tree but with a different point of view and with different CPUs.

Let me know if there is interest in this porting :)

Anyway, I will publish soon my work here: https://github.com/nuraci/micropython

Thank you Damien, your MicroPython is great!!

Hoping is the right place for write this....
Regards,
Nunzio

@dpgeorge
Copy link
Member

The Nucleo board is lacking in a USB connector and SD card slot, so that really limits its utility. You'd need to use UART for the REPL (not so bad), but the filesystem would be just the internal one, and there'd be no way to access it from the PC (since there is no USB, so no MSD). So from this point of view I don't think it's worth supporting this hardware (otherwise people are going to ask many questions about how to get the filesystem working, etc).

What is your motivation for using the Nucleo board? The pyboard is a better option :)

@nuraci
Copy link
Author
nuraci commented Nov 27, 2014

Hi Damien,
yes, you are right,
your board is really superb,
what I love using the Nucleo board is the capability to use its shields, probably simply adding a .py file as python library.
Regarding Nucleo limits, my proposal is to add a "recv()" command and so send the .py file through the xmodem protocol.
What do you think about?

@dpgeorge
Copy link
Member

my proposal is to add a "recv()" command and so send the .py file through the xmodem protocol.

You could probably write this in Python itself, a Python function that receives using the xmodem protocol.

@nuraci
Copy link
Author
nuraci commented Nov 27, 2014

Of course, also send the file could be made from an IDE, avoiding the user to perform the command by hand...

@dpgeorge
Copy link
Member

@nuraci did you get something working for the F401?

@nuraci
Copy link
Author
nuraci commented Dec 21, 2014

@dpgeorg 8000 e yes, some things work and pass the tests, I am currently trying to use the REPL_RAW feature in order to obtain the "Run" functionality through an IDE.

@dpgeorge
Copy link
Member

Is it something we can merge into this repository?

@nuraci
Copy link
Author
nuraci commented Dec 21, 2014

I'd love to, but I should probably talk to you before about some choices I took (1) and how to address some issues(2).
some examples:
(1) Some files contain substantial changes, so I created the subdirectory "nucleo".
(2) Other "common" files need changes due the different micro e.g. nuraci@645aa42
or
nuraci@8effc84

@dpgeorge
Copy link
Member

As long as it mostly fits the stmhal framework we should merge it. We can provide macro options for RTC, ADC, timer etc differences.

@nuraci
Copy link
Author
nuraci co 8000 mmented Dec 21, 2014

I agree and happy to hear this, could you help me in order to go ahead?

@AWCharlie
Copy link

Can MicroPython run as an app on top of the mbed OS? Mbed alpha 1 is
scheduled for this month, so we don't know much about it unless very
involved, but it looks like a good horse to be hitched to for IoT.

-- Charlie

On Sun, Dec 21, 2014 at 2:02 PM, Nunzio Raciti notifications@github.com
wrote:

I agree and happy to hear this, could you help me in order to go ahead?


Reply to this email directly or view it on GitHub
#989 (comment)
.

@aniljava
Copy link

Sorry to revive the old thread.

Is the nucleo support working yet.
I did a quick make deploy with nuraci port, files gets copied to the MBED file system but nothing after that.

Or the os is not picking up the micropython fs.

Linux 3.18.6-1-ARCH #1 SMP PREEMPT Sat Feb 7 08:44:05 CET 2015 x86_64 GNU/Linux

Dmesg logs:

[254979.244635] usb 4-1: new full-speed USB device number 37 using xhci_hcd
[254979.526716] usb 4-1: ep 0x84 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[254979.584597] usb-storage 4-1:1.1: USB Mass Storage device detected
[254979.584729] scsi host30: usb-storage 4-1:1.1
[254979.585151] cdc_acm 4-1:1.2: This device cannot do calls on its own. It is not a modem.
[254979.585164] cdc_acm 4-1:1.2: ttyACM0: USB ACM device
[254980.586665] scsi 30:0:0:0: Direct-Access     MBED     microcontroller  1.0  PQ: 0 ANSI: 2
[254980.587327] sd 30:0:0:0: [sdd] 1072 512-byte logical blocks: (548 kB/536 KiB)
[254980.587546] sd 30:0:0:0: [sdd] Write Protect is off
[254980.587548] sd 30:0:0:0: [sdd] Mode Sense: 03 00 00 00
[254980.587771] sd 30:0:0:0: [sdd] No Caching mode page found
[254980.587773] sd 30:0:0:0: [sdd] Assuming drive cache: write through
[254980.605564]  sdd:
[254980.606867] sd 30:0:0:0: [sdd] Attached SCSI removable disk

@nuraci
Copy link
Author
nuraci commented Apr 1, 2015

Hi,

are you sure that the file you have copied was the firmware.bin?

(see in attach).

Nunzio

2015-04-01 1:18 GMT+02:00 aniljava notifications@github.com:

Sorry to revive the old thread.

Is the nucleo support working yet.
I did a quick make deploy with nuraci port, files gets copied to the MBED
file system but nothing after that.

Or the os is not picking up the micropython fs.

Linux 3.18.6-1-ARCH #1 SMP PREEMPT Sat Feb 7 08:44:05 CET 2015 x86_64 GNU/Linux

Dmesg logs:

[254979.244635] usb 4-1: new full-speed USB device number 37 using xhci_hcd
[254979.526716] usb 4-1: ep 0x84 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[254979.584597] usb-storage 4-1:1.1: USB Mass Storage device detected
[254979.584729] scsi host30: usb-storage 4-1:1.1
[254979.585151] cdc_acm 4-1:1.2: This device cannot do calls on its own. It is not a modem.
[254979.585164] cdc_acm 4-1:1.2: ttyACM0: USB ACM device
[254980.586665] scsi 30:0:0:0: Direct-Access MBED microcontroller 1.0 PQ: 0 ANSI: 2
[254980.587327] sd 30:0:0:0: [sdd] 1072 512-byte logical blocks: (548 kB/536 KiB)
[254980.587546] sd 30:0:0:0: [sdd] Write Protect is off
[254980.587548] sd 30:0:0:0: [sdd] Mode Sense: 03 00 00 00
[254980.587771] sd 30:0:0:0: [sdd] No Caching mode page found
[254980.587773] sd 30:0:0:0: [sdd] Assuming drive cache: write through
[254980.605564] sdd:
[254980.606867] sd 30:0:0:0: [sdd] Attached SCSI removable disk


Reply to this email directly or view it on GitHub
#989 (comment)
.

@aniljava
Copy link
aniljava commented Apr 3, 2015

(see in attach), I did not see attachment in github or in email if there was one.

I retried the whole process, was able to access over serial console but could not mount fatfs.
Here is the overview:
LAST FEW LINES OF MAKE

# make
...
arm-none-eabi-size build-STM32NUCF401/firmware.elf
   text    data     bss     dec     hex filename
 222956      20   21980  244956   3bcdc build-STM32NUCF401/firmware.elf
Create the (mbed Enabled) binary build-STM32NUCF401/firmware.bin
arm-none-eabi-objcopy -O binary -j .isr_vector -j .text -j .data build-STM32NUCF401/firmware.elf build-STM32NUCF401/firmware.bin

DMESG AFTER CONNECTING NUCLEO

[47269.169610] usb 5-1: new full-speed USB device number 24 using xhci_hcd
[47269.451807] usb 5-1: ep 0x84 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[47269.509711] usb-storage 5-1:1.1: USB Mass Storage device detected
[47269.509936] scsi host17: usb-storage 5-1:1.1
[47269.510556] cdc_acm 5-1:1.2: This device cannot do calls on its own. It is not a modem.
[47269.510574] cdc_acm 5-1:1.2: ttyACM0: USB ACM device
[47270.514815] scsi 17:0:0:0: Direct-Access     MBED     microcontroller  1.0  PQ: 0 ANSI: 2
[47270.515575] sd 17:0:0:0: [sdc] 1072 512-byte logical blocks: (548 kB/536 KiB)
[47270.515858] sd 17:0:0:0: [sdc] Write Protect is off
[47270.515863] sd 17:0:0:0: [sdc] Mode Sense: 03 00 00 00
[47270.516086] sd 17:0:0:0: [sdc] No Caching mode page found
[47270.516092] sd 17:0:0:0: [sdc] Assuming drive cache: write through
[47270.534041]  sdc:
[47270.535584] sd 17:0:0:0: [sdc] Attached SCSI removable disk


# mount /dev/sdc /media/root/NUCLEO

# ls -l /media/root/NUCLEO/
total 8
-rwxr-xr-x 1 root root  512 Dec 14  2012 mbed.htm
drwxr-xr-x 2 root root 4096 Nov 19  2013 System Volume Information

COPIED THE FIRMWARE

# cp build-STM32NUCF401/firmware.bin /media/root/NUCLEO/

ACCESS OVER THE SERIAL CONSOLE AND VERIFY THE /flash exists with files

Press CTRL-A Z for help on special keys

import os
>>> os.listdir('/flash')
['main.py', 'demo.py', 'README.txt', 'boot.py']
>>> 

AFTER RESET / RECONNECTION :

# ls /media/root/NUCLEO/
mbed.htm  System Volume Information

I also tried 0 and 1 for ,
#define MICROPY_HW_HAS_SDCARD (1)
nucleo/boards/STM32NUCF401/mpconfigboard.h

@dpgeorge
Copy link
Member

@nuraci I recently added support for the F401 and F411 MCUs so maybe this helps you?

@pfalcon
Copy link
Contributor
pfalcon commented Jun 6, 2015

Any updates on this ticket? Proposed closing it, forum can be used for further communications, patches can be submitted to patch tracker when ready.

@dpgeorge
Copy link
Member
dpgeorge commented Jun 6, 2015

We could perhaps merge the board config file from: https://github.com/cnoviello/micropython/tree/master/stmhal/boards/STM32F4NUCLEO . @cnoviello is that ready to merge?

@cnoviello
Copy link
Contributor

Yes. It's ready, Feel free to merge.

@mikeredbike
Copy link

Anyone got a NUCLEO F746 board running?

@dpgeorge
Copy link
Member

@mikeredbike the F746 discovery board is (partially) supported. The nucleo version would be very similar. Please discuss this at forum.micropython.org if you want further info/help.

@dpgeorge
Copy link
Member

@cnoviello's board config files for the STM32F401NUCLEO board have been merged in 3d42aa0. His original commits were used but they were all squashed together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
0