Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ** Generate a pure Mecrisp-Stellaris image for STM32F103 with serial i/o
- #+BEGIN_EXAMPLE
- cd $O/embello-1.6/explore/1608-forth/g6s
- awk -f fpp.awk board36.hex > /tmp/forth-code.fs
- cd $O/mecrisp-stellaris-2.4.1/mecrisp-stellaris-source/stm32f103-ra
- make
- cd $O/mecrisp-stellaris-2.4.1/thumbulator
- ./compile
- ./buildcore-stm ./thumbulator-stm32f103 \
- ../mecrisp-stellaris-source/stm32f103-ra/mecrisp-stellaris-stm32f103.bin \
- /tmp/forth-code.fs /tmp/image.bin
- #+END_EXAMPLE
- from :board.fs:
- - included proper pins36.fs
- - removed eraseflash from the beginning
- - added definition of cornerstone
- - removed calling of old init
- #+BEGIN_EXAMPLE fpp.awk
- BEGIN { FS=" " }
- /^include / || /^require / {
- print "\\ " $0
- system("awk -f fpp.awk " $2)
- next }
- {
- sub(/ \\ .*/, "")
- print }
- #+END_EXAMPLE
- #+BEGIN_EXAMPLE board36.fs
- \ board definitions
- \ eraseflash
- \ cr
- compiletoflash
- ( board start: ) here dup hex.
- 4 constant io-ports \ A..D
- include ../flib/mecrisp/calltrace.fs
- include ../flib/mecrisp/cond.fs
- include ../flib/mecrisp/hexdump.fs
- include ../flib/stm32f1/io.fs
- include ../flib/pkg/pins36.fs
- include ../flib/stm32f1/hal.fs
- include ../flib/stm32f1/spi.fs
- include ../flib/stm32f1/i2c.fs
- include ../flib/stm32f1/timer.fs
- include ../flib/stm32f1/pwm.fs
- include ../flib/stm32f1/adc.fs
- include ../flib/stm32f1/rtc.fs
- : cornerstone ( "name" -- ) \ define a flash memory cornerstone
- <builds begin here dup flash-pagesize 1- and while 0 h, repeat
- does> begin dup dup flash-pagesize 1- and while 2+ repeat cr
- eraseflashfrom ;
- : hello ( -- ) flash-kb . ." KB <g6s> " hwid hex.
- $10000 compiletoflash here - flashvar-here compiletoram here -
- ." ram/flash: " . . ." free " ;
- : init ( -- ) \ board initialisation
- \ init \ uses new uart init convention
- ['] ct-irq irq-fault ! \ show call trace in unhandled exceptions
- jtag-deinit \ disable JTAG, we only need SWD
- 72MHz
- 1000 systick-hz
- hello ." ok." cr
- ;
- cornerstone <<<board>>>
- hello
- words
- #+END_EXAMPLE
Add Comment
Please, Sign In to add comment