CoreForth-0

cortex/boards/nucleo-l031k6.ft.md


Host ———————————————————————

::host::

::dtc:: cr ." *** DTC not supported ***" cr bye

../janus/compiler.ft

Target ——————————————————————-

::target::

$08000000 to trom
$20000000 to tram
        4 to tcell

trom tdp !
tram tvp !

tram $00001000 + t, 0 t,
trom $00000400 + torg

../cpus/cortex-m0/armv6-m-primitives.ft

::stc:: include ../cpus/cortex-m0/threading-stc.ft
::itc:: include ../cpus/cortex-m0/threading-itc.ft

          $FC buffer: psp
             variable s0
          $FC buffer: rsp
             variable r0

../common/core.ft

../../common/core.ft

../dictionary/common.ft

../cpus/stm32l0xx/rcc.ft

../cpus/stm32l0xx/flash.ft

../cpus/stm32l0xx/gpio.ft

../cpus/stm32l0xx/usart.ft

: emit          begin USART2_ISR c@ %10000000 and until USART2_TDR c! ;
: key?          USART2_ISR c@ %00100000 and ;
: key           begin key? until USART2_RDR c@ ;

../../common/output.ft

../../common/input.ft

../dictionary/full.ft

::stc:: include ../common/threading-stc.ft
::itc:: include ../common/threading-itc.ft

../../common/exception.ft

../../common/control-flow.ft

../common/compiler.ft

../../common/interpret.ft

../../common/utils.ft

../janus/init.ft

: 16mhz        %00000001 RCC_CR ! begin RCC_CR @ %00000100 and until
               %00000001 RCC_CFGR !
               ;

: uart-init    %00100000000000000000 RCC_APB1ENR bis!
               GPIOA_MODER dup @ $3FFFFFCF and $80000020 or swap !
               GPIOA_AFRL dup @ $FFFFF0FF and $00000400 or swap !
               GPIOA_AFRH dup @ $0FFFFFFF and $40000000 or swap !
               RCC_CCIPR dup @ $FFFFFFF3 and $00000008 or swap !
               #138 USART2_BRR !
               %00001101 USART2_CR1 bis!
               ;

: led-init     GPIOB_MODER dup @ $FFFFFF3F and $00000040 or swap ! ;
: +led         $00000008 GPIOB_BSRR ! ;
: -led         $00000008 GPIOB_BRR ! ;
: ~led         GPIOB_IDR @ $00000008 xor GPIOB_ODR ! ;

: hw-init      %00000000000000000011 RCC_IOPENR !
               16mhz
               led-init
               uart-init
               ;

: cold         s0 sp! r0 rp!
               0 (source-id) !
               setup-vars
               hw-init
               hex
               abort
               begin wfi again
               ;

Host ———————————————————————

::host::

../janus/save-image.ft

::stc:: s" nucleo-l031k6-stc.hex" save-hex
::itc:: s" nucleo-l031k6-itc.hex" save-hex