Resolved: Error uploading timed.fs on a jnz
(Just joining this forum, thanks)
Problem: timed.fs does not load correctly on a jnz, but is ok on a bluepill; workaround proposed.
Uploading timed.fs on a jnz raises this error:
!send timed.fs 1> timed.fs 104: Jump too far Send failed. hello 64 KB <jz4> 2046052C ram/flash: 2898 21248 free ok.
Line 104 is the closing of timed. definition:
cr loop ;
which compiles a back jump to 'do', and a 'Jump too far' error would point a range problem.
We can verify that the range of jump is exceeded by shortening a bit the definition of timed. .
This error does not appear on a Bluepill, as the coding of jump range has differences between M0 and M3.
As a work around solution, this code is ok for a jnz:
: show1timer ( n -- ) ." Timer #" dup . ." Interval: " dup tmd-inte-addr @ . ." Last-Run: " dup tmd-last-addr @ . ." Callback: " dup tmd-call-addr @ . ." Repeat: " tmd-repe-addr @ . ; \ Show all timers : timed. ( -- ) cr MAX-TIMED 0 do i show1timer cr loop ;