Mecrisp-Cube for the STM32H74x Powerhouse
Intro MecrispCubeH74x
DRAFT

New flavors for Mecrisp-Cube:

If you need a really fast MCU (ARM Cortex M7 @ 480 MHz) then the MecrispCubeH74x could be the right Mecrisp-Cube Forth for you. The STM32H747 has even a second Core, a Cortex M4.

Mecrisp-Cube Instant real-time programming with Forth.

Sources on

  • GitHub (H743 branch on Mecrisp-Cube)
  • GitHub (H747 branch on Mecrisp-Cube)

Features

The standard Mecrisp-Cube features like RTOS, Filesystem, USB, etc.

  • 288 KiB RAM dictionary
  • 1 MiB Flash dictionary, because of the fragmentation (32 byte instead of 16 byte blocks) the flash words needs about 30 % more memory.
  • Internal Flash drive 0:, 16 MiB (external, Portenta has it on board)
  • microSD drive 1: on Breakout Board

  • TCP/IP
    • Telnet wink

Getting Started

These instructions will get you a copy of the project up and running on your local machine (STM's NUCLEO-H743ZI board) for development and testing purposes.

Prerequisites

  • STM's NUCLEO-H743ZI
  • Terminal emulator application for PC, e.g.:
    • PuTTY - Windows and Linux
    • Tera Term - Windows
    • Realterm - Windows
    • minicom, microcom, screen - Linux
    • Use the built in Eclipse console (but no LF)

Flash the Mecrisp-Cube binary (MecrispCubeH743.bin) or the util-binary (MecrispCubeH743Util.bin) to the Feather Board.

  1. Connect the Nucleo Board USB ST-LINK to the PC
  2. Copy the binary or the util-binary to the USB mass storage NODE_H743

Start the terminal emulator application on the PC. Check for the serial communication port (e.g. for Linux /dev/ttyACM0). I set the putty terminal configuration to

  • Implicit CR in every LF
  • Local echo: Auto
  • Local line editing: Auto
  • Keyboard Backspace: Control-H
  • Keyboard Function: Keys VT100
  • Remote character set: CP850

Mecrisp-Stellaris RA 2.5.4 by Matthias Koch.

Mecrisp-Cube 1.5.0 for STM32H7 Nucleo, 288/1024  KiB RAM/FLASH dictionary (C) 2022 peter@spyr.ch
  * Firmware Package STM32Cube H7 V1.10.0, USB-CDC (C) 2021 STMicroelectronics
  * CMSIS-RTOS V2 FreeRTOS wrapper, FreeRTOS Kernel V10.3.1 (C) 2020 Amazon.com
  * FatFs for internal flash and microSD - Generic FAT fs module  R0.12c (C) 2017 ChaN
  * tiny vi - part of BusyBox (C) 2000, 2001 Sterling HuxleyMecrisp-Cube 1.4.3 for STM32F405, 31/768 KiB RAM/FLASH dictionary (C) 2021 peter@spyr.ch
  * Firmware Package STM32Cube F4 V1.26.0, USB-CDC (C) 2021 STMicroelectronics
  * CMSIS-RTOS V2 FreeRTOS wrapper, FreeRTOS Kernel V10.3.1 (C) 2020 Amazon.com
  * FatFs for serial flash and microSD - Generic FAT fs module  R0.12c (C) 2017 ChaN
  * tiny vi - part of BusyBox (C) 2000, 2001 Sterling Huxley

include 0:/etc/rc.local

23 5 / .[CR] 4  ok.
: hello ." World" ;[CR]  ok.
hello[CR] World ok.

Additional Tools and Local Filesystem

Populate a microSD with the contents of sdcard. Put the microSD into the H743 slot and reset or power cycle the board.

The directory should look like this:

ls -l 1:[CR]
drw-         0 2021-04-18T18:12:38 boot
drw-         0 2021-03-21T18:47:52 etc
drw-         0 2021-03-21T18:47:54 fsr
drw-         0 2021-03-21T18:47:54 home
drw-         0 2021-03-21T18:47:56 man
-rwa      7219 2021-01-08T19:42:36 README.md
ok.

You can use the local CLI commands like mkfs, mkdir and cp to create a filesystem on the serial flash and fill it with files and folders. But this is tedious job because I haven't yet implemented a recursive copy for MecrispCube. But there is prepared disk image (for details see MicroSdBlocks#Serial_Flash) on microSD and the tool dd. You can copy the disk image to the drive 0: (this takes about 2 Minutes):

dd 1:/boot/fd-2MiB.img 0:[CR]
 ok.
mount 0:[CR]
 ok.
ls 0:[CR]
man                     fsr                     README.md               boot
etc                     home
 ok.

The Mecrisp have some tools bundled in its distribution e.g. assembler, disassembler, dump, float. I put those tools and some more into the folder /fsr. With the "init.fs script" I compile my favorite ones into the flash directory:

compiletoflash[CR]  ok.
include /etc/init.fs[CR]
init.fs Loading started
RAM Dictionary: 392991 KiB
utils.fs loading ...
conditional.fs loading ...
dump.fs loading ...
disassembler-m3.fs loading ...
float.fs loading ...
threads.fs loading ...
RAM Dictionary: 392981 KiB
init.fs finished  ok.

For example, the word disassember is available now:

see dump[CR]
080405F0: B500  push { lr }
080405F2: F7C2  bl  08002A3E  --> cr
080405F4: FA24
080405F6: CF08  ldmia r7 { r3 }
080405F8: F013  ands r2 r3 #F
080405FA: 020F
080405FC: F847  str r3 [ r7 #-4 ]!
080405FE: 3D04
08040600: 2A00  cmp r2 #0
08040602: D000  beq 08040606
08040604: 3610  adds r6 #10
08040606: CF08  ldmia r7 { r3 }
08040608: F847  str r6 [ r7 #-4 ]!

Installing

A step by step series of examples that tell you how to get a development env running

Install the IDE STM32CubeIDE, it is Eclipse and GCC based. STM32CubeMX is included in the IDE, you need a stand alone installation only if you do not want to use the STM32CubeIDE.

Get the sources from github:

psi@homer:~> git clone --branch H743 https://github.com/spyren/Mecrisp-Cube
Cloning into 'Mecrisp-Cube'...
remote: Enumerating objects: 4969, done.
remote: Counting objects: 100% (47/47), done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 4969 (delta 13), reused 47 (delta 13), pack-reused 4922
Receiving objects: 100% (4969/4969), 69.43 MiB | 3.54 MiB/s, done.
Resolving deltas: 100% (3481/3481), done.
Updating files: 100% (213/213), done.

Import the project into the IDE:

File -> Import -> General -> Existing Projects into Workspace -> Select root directory
Copy project into workspace
Browse to Mecrisp-Cube directory

Generate code from the STM32CubeMX MecrispCubeH743.ioc file:

Project -> Generate Code 

Restore changed source files

$ git status
{list of changed files}
$ git restore {files to restore} 

Select the Build Configuration (Debug if you want to debug the project) and Build the project:

Project -> Build Configurations -> Set Active -> Debug/Release 
Project -> Build Project

STM32H7 Development Boards

STM32H743 H743ZI2 Nucleo Board

pinout legend 2017-06-28-2.png
Pinout Legend

nucleo h743zi2 zio left 2019 10 9.png
ZIO/Arduino CN8 CN9 left
nucleo h743zi2 zio right 2019 10 9.png
ZIO/Arduino CN7 CN10 right
nucleo h743zi2 morpho left 2019 10 9.png
Morpho CN11 left
nucleo h743zi2 morpho right 2019 10 9.png
Morpho CN12 right

STM32H747 Arduino Portenta H7 Development Board

This Arduino Portenta H7 development board follows the Arduino MKR form factor, but enhanced with the Portenta family 80 pin high-density connector.

Why should I use this board? It is less powerful than a Raspberry Pi and is even more expensive! The Raspi draws much more current and therefore cannot be operated with a battery.

No Board Support Package yet.

https://docs.arduino.cc/hardware/portenta-h7

portenta-h7-pinout.png
Portenta H7 Pinout

Schematics

The much smaller board Arduino Nicla Vision equipped with a 2MP camera.

Wio Lite AI Single Board

No Board Support Package yet.

-- Peter Schmid - 2022-03-04

Creative Commons License
This work by Peter Schmid is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Topic attachments
ISorted ascending Attachment History Action Size Date Who Comment
JPEGjpg NUCLEO-H743ZI2-header.jpg r1 manage 84.3 K 2022-03-06 - 15:04 PeterSchmid  
JPEGjpg NUCLEO-H743ZI2.jpg r1 manage 1692.9 K 2022-03-06 - 15:04 PeterSchmid  
PNGpng ABX00042-pinout.png r1 manage 372.1 K 2022-03-06 - 15:41 PeterSchmid  
PNGpng nucleo_h743zi2_morpho_left_2019_10_9.png r1 manage 458.5 K 2022-03-06 - 17:14 PeterSchmid  
PNGpng nucleo_h743zi2_morpho_right_2019_10_9.png r1 manage 399.1 K 2022-03-06 - 17:14 PeterSchmid  
PNGpng nucleo_h743zi2_zio_left_2019_10_9.png r1 manage 498.7 K 2022-03-06 - 17:14 PeterSchmid  
PNGpng nucleo_h743zi2_zio_right_2019_10_9.png r1 manage 423.5 K 2022-03-06 - 17:14 PeterSchmid  
PNGpng pinout_legend_2017-06-28-2.png r1 manage 33.9 K 2022-03-06 - 17:14 PeterSchmid  
PNGpng portenta-h7-pinout.png r1 manage 372.1 K 2022-06-09 - 19:49 PeterSchmid  
Unknown file formatwebp ABX00045_02.front_1000x750.webp r1 manage 118.2 K 2022-03-06 - 15:41 PeterSchmid  
Unknown file formatwebp Arduino-Nicla-Vision.webp r1 manage 178.9 K 2022-06-26 - 21:10 PeterSchmid  
Edit | Attach | Watch | Print version | History: r22 < r21 < r20 < r19 < r18 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r22 - 2022-12-28 - PeterSchmid
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback