jfe` has joined #forth
tabemann has joined #forth
<tabemann> hey guys
MrMobius has quit [Ping timeout: 240 seconds]
[1]MrMobius has joined #forth
MrMobius has joined #forth
[1]MrMobius has quit [Ping timeout: 256 seconds]
jfe` has quit [Ping timeout: 256 seconds]
tabemann has quit [Ping timeout: 265 seconds]
reepca has joined #forth
[1]MrMobius has joined #forth
MrMobius has quit [Ping timeout: 272 seconds]
[1]MrMobius is now known as MrMobius
jfe` has joined #forth
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
jsoft has quit [Ping timeout: 260 seconds]
jsoft has joined #forth
jfe` has quit [Ping timeout: 260 seconds]
tabemann has joined #forth
<tp> tabemann, hey
dave0 has quit [Quit: dave's not here]
<tp> tabemann, I fixed my little scheduler bug, all working nicely now :)
<tabemann> nice
<tabemann> I'm dealing with a stupid bug where begin-structure ... end-structure doesn't work in compile-to-flash mode
<tp> I don't need or want the complexity and resource use of a multitasker but Ive been needing a simple scheduler for a while
<tabemann> the multitasker I'm writing is pretty small
<tp> 'small' is a relative term ")
<tabemann> if you don't need much stack space, a task can be very small with it
jfe` has joined #forth
<tp> the Mecrisp-Stellaris tasker uses 800 bytes of ram per task, I think ram usage per task is a metric that can be used to describe one ?
<tabemann> well I've allocated 256 to each main stack in zeptoforth
<tp> my current project is a stm32f051 64kB flash/8kB ram Touch Sensor peripheral evaluator 'kit' and when loaded into flash, and running the scheduler has these stats
<tp> Total Flash:65536 Free:17408 Used:48128
<tp> Total Ram:8192 Free:2148 Used:6044
<tp> oops
<tp> thats in ram
<tp> when flashed, it comes up like this after a cold boot
<tp> -------------
<tp> Main Menu '?'
<tp> s - Scan every 100ms: led lit on touch, print touch counter values. Exit: Press 'm'
<tp> -------------
<tp> i - print technical Information.
<tp> m - Menu.
<tp> e - Extra menu, memory stats, credits, license.
<tp> q - Quit to Forth OS terminal.
<tp> Please select a Menu Option :
<tp> this is the memory usage when running from flash
<tp> Memory stats in bytes:
<tp> Total Flash:65536 Free:12920 Used:52616
<tp> Total Ram:8192 Free:7096 Used:1096
<tp> the asterisks represent the sensor being touched
<tp> 5129
<tp> 5130
<tp> 762 *
<tp> 795 *
<tp> 771 *
<tp> 762 *
<tp> 3621 *
<tp> 5142
<tp> I've set it to a high sensitivity level and it's triggered with my hand 1/2 inch above the sensor plate
<tp> which is about 1/2" x 1" copper on fibreglass pcb
<tabemann> nice
[1]MrMobius has joined #forth
<tp> a coin with a wire attached would work fine provided it's under some plastic
<tp> I was sceptical about the stability of this peripheral when I started the project but it's 100% solid and reliable
<tp> especially as it's running on a Disco board which is not made for low noise or specially designed for any peripheral
MrMobius has quit [Ping timeout: 265 seconds]
[1]MrMobius has quit [Ping timeout: 240 seconds]
MrMobius has joined #forth
<tabemann> now the question is what are its applications...
<tp> plenty
<tp> the most obvious is a 'button'
<tp> touch the pad with a finger to activate something
<tp> ill have one on my development system MCU reset for instance
<tp> because I literally wear out push button switches
<tp> mainly the black one on the Disco which is the reset button. Ive worn out a couple of Discos that way so far
<tp> this is why a *fast* upload is *vital* to a embedded Forth development system
<tp> say you're developing code that has 1000 lines in ram at this present moment, you upload and get the usual 10 errors because of some typo for worse
<tp> the only way to proceed is to hit the mcu reset button
<tp> and then fix the source, re upload ...
<tp> I keep my ram loads small by moving tested Words to Flash, and do this 'housekeeping' regularly
<tabemann> with my board what I do is use st-flash, which automatically reboots the board when I reflash
<tabemann> of course I'm wearing out the flash this way...
<tabemann> also I made a REBOOT word
<tabemann> which reboots the board without having to touch the reset switch
<tp> yeah, Im just developing Forth applications, youre developing a Forth which is far harder
<tp> a hardware reset is essential for me, bad source can (and does) raise a exception which results in a frozen MCU after the calltrace has been dumped
<tp> the only way out is a hardware reset
<tabemann> I've never found a situation that reflashing the board doesn't fix
jfe` has quit [Ping timeout: 258 seconds]
<tp> when I upload new code the mcu is always reset via software first
<tabemann> mind you often what happens is that I wedge the board so it won't even software boot
<tp> heh, yeh
<tabemann> e.g. if the init routine causes a crash, as has been happening with my multitasker
<tp> assembly code and flash is the biggest challenge
<tp> because when the result is nothing obvious it's back to the drawing board
[1]MrMobius has joined #forth
<tp> Forth is like the living dead in that respect because a running Forth will always tell you what went wrong, unlike assembly
<tp> which is why I use Forth
<tp> I like assembler also, but only 6800 or msp430, just not cortex-m assembler
<tabemann> whereas I find assembly easier to debug because gdb will work with assembler
MrMobius has quit [Ping timeout: 240 seconds]
[1]MrMobius is now known as MrMobius
<tabemann> whereas if Forth crashes, well, there's no debugger
<tp> gdb mostly works with assembler :)
<tp> when I first started doing cortex-m assy my blinky program didn't as is very common
<tabemann> gdb doesn't work with disassembled code well, only code that has assembly sources available
<tabemann> which sucks
<tp> so when I set up the GDB stuff in that tarball I put on my site for you, I was sure that GDB would tell me what was wrong, but all that happened was the PC flew to the end of memory and everything stopped
<tabemann> as tehre have been a number of occasions here I wanted to use gdb on Forth code but couldn't
<tp> unlike Cutter which takes a binary and 'runs' it, kinda
<tabemann> I had very little luck with Cutter
<tabemann> it didn't provide a sufficient emulation of the STM32L476
<tp> in the old days I has a really nice simulator made by Avocet for the 68hc11. I could run assembled binary without source and step thru etc
<tp> it showed the registers etc, all the stuff one wants
<tp> that what I hoped Cutter would be for me, and it does work, but is a pain to set up
<tp> tabemann, have you seen the 'thumbulator' ?
<tp> thats a cli cortex-m emulator for the pc
<tp> and it works well enough that matthias uses it in his releases
<tabemann> I have heard of it, never used it
<tp> might be worth checking out
<tp> Thumbulator is a Thumb (16 bit ARM) instruction set simulator by dwelch67 https://github.com/dwelch67/thumbulator
<tp> Thumbulator is a simple alternative to QEMU/KVM etc.
<tp> Note
<tp> A modified Thumbulator is supplied and used with Mecrisp-Stellaris
<tp> oh, it may not work for the M4 !
<tp> oops, sorry I have given you incorrect info, the thumbulator doesnt seem to have a M4 version
<tp> matthias has modified the basic Thumbulator to work with some chips, but not the M4
<tp> i was surprised recently, a Mecrisp-Stellaris user submitted a ported version for the stm32wb55 (stm32 mcu with inbuilt wireless) and he used my forth2svd stuff for his package
<tabemann> back
<tp> bit late in Wisconsin ?
<tabemann> yeah; it's 11:06 pm here
<tabemann> okay, now it attempts to multitask, but fails
<proteusguy> WilhelmVonWeiner, let me know what you think. It's "something completely different" I suspect.
<tabemann> okay, I figured out my problem
<tabemann> the stack was exploding quickly with every PAUSE cycle
<tp> heh
gravicappa has joined #forth
jsoft has quit [Ping timeout: 256 seconds]
jsoft has joined #forth
reepca has quit [Ping timeout: 258 seconds]
reepca has joined #forth
reepca has quit [Ping timeout: 256 seconds]
<tp> tabemann, you should read this :) https://www.radare.org/get/r2snow.pdf
<tp> it's a cli tutorial on radare2
reepca has joined #forth
[1]MrMobius has joined #forth
MrMobius has quit [Ping timeout: 265 seconds]
[1]MrMobius is now known as MrMobius
[1]MrMobius has joined #forth
MrMobius has quit [Ping timeout: 255 seconds]
[1]MrMobius is now known as MrMobius
rdrop-exit has joined #forth
dys has quit [Ping timeout: 265 seconds]
jfe` has joined #forth
jfe` has quit [Ping timeout: 240 seconds]
jfe` has joined #forth
jfe` has quit [Ping timeout: 258 seconds]
C-Keen has joined #forth
[1]MrMobius has joined #forth
jfe` has joined #forth
MrMobius has quit [Ping timeout: 255 seconds]
[1]MrMobius is now known as MrMobius
jfe` has quit [Remote host closed the connection]
jfe` has joined #forth
[1]MrMobius has joined #forth
MrMobius has quit [Ping timeout: 256 seconds]
[1]MrMobius is now known as MrMobius
jfe` has quit [Ping timeout: 265 seconds]
jfe` has joined #forth
jfe` has quit [Remote host closed the connection]
jfe` has joined #forth
_whitelogger has joined #forth
jfe` has quit [Ping timeout: 265 seconds]
jfe` has joined #forth
jfe` has quit [Ping timeout: 260 seconds]
jfe` has joined #forth
mtsd has joined #forth
jfe` has quit [Ping timeout: 258 seconds]
MrMobius has quit [Ping timeout: 265 seconds]
jfe` has joined #forth
MrMobius has joined #forth
dddddd has quit [Ping timeout: 265 seconds]
jfe` has quit [Ping timeout: 260 seconds]
jfe` has joined #forth
cartwright has quit [Ping timeout: 240 seconds]
jfe` has quit [Ping timeout: 265 seconds]
mstevens has quit [Ping timeout: 260 seconds]
mstevens has joined #forth
jfe` has joined #forth
cartwright has joined #forth
xek has joined #forth
jfe` has quit [Ping timeout: 255 seconds]
jfe` has joined #forth
dave0 has joined #forth
reepca has quit [Ping timeout: 265 seconds]
reepca has joined #forth
WickedShell has quit [Remote host closed the connection]
Croran has quit [Ping timeout: 240 seconds]
Croran has joined #forth
MrMobius has quit [Ping timeout: 265 seconds]
[1]MrMobius has joined #forth
MrMobius has joined #forth
[1]MrMobius has quit [Ping timeout: 240 seconds]
[1]MrMobius has joined #forth
MrMobius has quit [Ping timeout: 240 seconds]
MrMobius has joined #forth
[1]MrMobius has quit [Ping timeout: 256 seconds]
rdrop-exit has quit [Quit: Lost terminal]
gravicappa has quit [Ping timeout: 258 seconds]
iyzsong has quit [Ping timeout: 272 seconds]
<remexre> g'morning all
<tp> good morning remexre
<proteus-guy> howdy
<tp> remexre, I have just this second uploaded my latest Forth project :) https://mecrisp-stellaris-folkdoc.sourceforge.io/touch-sensor.html
<tp> hey proteus-guy !
<remexre> tp: nice!
<tp> Forth again sweeps the competition into the weeds!
<proteus-guy> tp, nice going.
<tp> proteus-guy, ta, that's the kind of stuff I do
<tp> being a technician
<tp> the hardest part was working out the C code in the STMicro factory example, then debugging my first simple Forth scheduler
<proteus-guy> tp, you're employed to do this stuff or you are self-employed doing this?
<tp> whilst searching for code examples for the TSC I came across a plea for help on stack-exchange that was 12 months old. Someone had written it up in C and was mystified why it refused to work
<tp> proteus-guy, I'm a old guy, I used to do this while self employed, starting embedded in 1974
<tp> now Im semi retired, learning Forth and still making small embedded gear that I sell
<tp> ironically whils the guy had got all the hard bits right, he had screwed up a simple config by one bit, because the C bit manipulation syntax he decided to use was error prone
<proteus-guy> you were doing embedded all those years and just now getting around to forth.
<tp> as MrMobius pointed out another layer of abstraction could have fixed it for him
<tp> yeah, I first saw Forth in 1987 but I was making hardware for the system, I'm not a programmer
<proteus-guy> well now you are! :-)
<tp> but the love the programmers has for the Forth they were using was infectious and stayed with me until I 'had the time' which for me was 2014
<tp> proteus-guy, nah, Im a technician who programs, I know what Im great at and what Im ordinary at :)
<tp> it took me a couple of years of pocking Forth with a stick and having no clue why anyone would use it until the 'penny dropped' for me
<proteus-guy> :-)
<tp> of course after that I never looked at anything else quite the same way
<tp> Forth isnt a OS, it's a journey ;-)
<tp> so I guess I took to Forth with a mission in 2016, tried a few forths always embedded ones
<tp> finally found that Mecrisp-Stellaris for cortex-m suited me just fine and have been making tools for it ever since
<tp> most recently Retro has been calling out to me to replace Perl and shell with it on my PC toolset
<tp> and I'm finding the Retro siren call harder and harder to resist
<proteus-guy> even better
<tp> and watching CRC using Retro is like watching a real Hacker using Vim, it's a stunning experience
<tp> and very humbling
<tp> a bit like riding your pushbike down the road when a Bugatti passes at 408 kph
<tp> proteus-guy, my last Forth public project is a diagnostics binary to analyse clone/fake microprocessors pretending to be STM32F103 chips. As of today that has been downloaded 181 times since last december mainly by American Windows users
<proteus-guy> that's good traffic for forth projects.
jfe` has quit [Ping timeout: 268 seconds]
<tp> heheh, yeah I was stunned when it passed 42 downloads!
<tp> I mean at that level I figured every Forth STM32 user in the world had one each
<proteus-guy> all this iot and embedded stuff seems to be making a forth resurgence. hoping it'll catch on beyond embedded devices.
<tp> but it's menu driven and I think 99% have no idea it's a Forth
<tp> the only thing Ive noticed thats 'popular' about embedded Forth is the hate it engenders amongst the younger population in online forums, and the few 'I used that once' reminisces by old retards like me
* proteus-guy remains a firm curmudgeon.
<tp> I'm willing to bet that all 'flat eathers' and 'moon landing hoaxers' hate Forth
<tp> the strongest hate I get is from people who have never used Forth and dont know anything about it
<tp> I guess the burden of crufty 'I hate Forth' articles has had the longest time to build up on the InterTubes ?
mtsd has quit [Quit: Leaving]
gravicappa has joined #forth
<tabemann> hey guys
<tp> hey tabemann i was just heading off for some zzz
<tabemann> have a good night then
<tp> tabemann, I released my Forth touch sensor demo
<tabemann> cool
jfe` has joined #forth
dddddd has joined #forth
* tabemann is a (relative) young-un who does not have forth at all
<tp> just a demo as most of the people who download my binaries are arduino windows users I think
<tabemann> well, if being 35 counts as being a "young-un"
<tp> I'm nearly 2x your age, but I still remember being 35, was a great time for me :)
<tabemann> now I just need to get my multitasker working
<tabemann> it works on bootup, with a single (main) task
<tabemann> but when I try to add another task, it breaks
<tp> sounds non trivial to me
<tp> I had enough problems with a simple scheduler!
<tabemann> I think it's just a problem with how I'm initializing the second task
<tp> oddly I can relate
<tp> it was my second task that was my problem
<tp> hahah, one is always ok
<tabemann> it works even when the second task exists until I activatethe second task
<tabemann> then it breaks
[1]MrMobius has joined #forth
<tp> hey I ran RA2 from the cli, it looks pretty good
<tp> radare2
<tabemann> cool
<tp> it's easily scripted, heaps better than the cutter gui
<tp> more like gdb
<tp> it may be what you want if GDB isnt doing it
<tp> it has a ton of plugins etc
<tp> anyway zz for me, it's 0121 here
<tp> cya
MrMobius has quit [Ping timeout: 256 seconds]
<tabemann> g'night
[1]MrMobius has quit [Ping timeout: 258 seconds]
MrMobius has joined #forth
tabemann has quit [Ping timeout: 265 seconds]
pierpal has joined #forth
jsoft has quit [Ping timeout: 255 seconds]
jfe` has quit [Ping timeout: 265 seconds]
jpsamaroo has joined #forth
[1]MrMobius has joined #forth
MrMobius has quit [Ping timeout: 256 seconds]
[1]MrMobius is now known as MrMobius
X-Scale` has joined #forth
X-Scale has quit [Ping timeout: 240 seconds]
X-Scale` is now known as X-Scale
pierpal has quit [Read error: Connection reset by peer]
jfe` has joined #forth
jfe` has quit [Ping timeout: 256 seconds]
dave0 has quit [Quit: dave's not here]
[1]MrMobius has joined #forth
jfe` has joined #forth
MrMobius has quit [Ping timeout: 260 seconds]
[1]MrMobius is now known as MrMobius
jfe` has quit [Ping timeout: 260 seconds]
phadthai has quit [Ping timeout: 255 seconds]
phadthai has joined #forth
<WilhelmVonWeiner> proteus-guy: I wonder if you could modify the interpreter so that an undefined type in a type signature represents an any
<veltas> Is there a common forth word for doing 'memset' i.e. set all bytes in a region to a given value?
[1]MrMobius has joined #forth
<WilhelmVonWeiner> that way `swap : A B -> B A` makes sense
<WilhelmVonWeiner> veltas: fill?
<veltas> Ah lovely
<veltas> Thank you
<veltas> Forth is the only language where I can't google stuff like "forth equivalent for memset"
<WilhelmVonWeiner> hahahaha look at the "suggested reference implementation"
<veltas> Does it use CMOVE?
<WilhelmVonWeiner> where : FILL >R BEGIN DUP 0<> WHILE OVER R@ SWAP C! 1 /STRING REPEAT R> DROP` is considered as reasonable
MrMobius has quit [Ping timeout: 256 seconds]
<WilhelmVonWeiner> the first guy said `: FILL ROT ROT 0 ?DO 2DUP C! CHAR+ LOOP 2DROP ;` which is so simple
<WilhelmVonWeiner> this is why nobody takes Forth standardisation seriously
[1]MrMobius has quit [Ping timeout: 255 seconds]
MrMobius has joined #forth
<veltas> : FILL OVER 0= IF 2DROP DROP EXIT THEN ROT DUP >R C! R> DUP 1+ ROT CMOVE ;
<veltas> (Untested) is roughly what I was expecting to see
<veltas> But writing it out that is horrific
<veltas> In Z80 this is how most people do 'memset' and I'm assuming 'fill', using the LDIR instruction where CMOVE is
<WilhelmVonWeiner> honestly I don't remember what CMOVE does
<veltas> It copies byte by byte in ascending address order
<veltas> CMOVE> is same in descending addresses
<veltas> So you copy the first byte over and then use cmove to fill with the rest
<veltas> Hmm I am already spotting a mistake because I should have a 1- at the end to do "the rest", not "one more"
<WilhelmVonWeiner> ah yeah
<veltas> You are welcome to ask for your money back, I did label it 'untested' and therefore with a full warranty
<veltas> Luckily I am sure no Forth programmer has ever copy+pasted code
<WilhelmVonWeiner> i probably did a bunch
<WilhelmVonWeiner> when i started
<WilhelmVonWeiner> you can probably do FILL smaller than that
<veltas> Okay let's code golf it in forth 2012
<WilhelmVonWeiner> I would try but i'm really tired rn
<veltas> : FILL ROT ROT 0 ?DO 2DUP C! 1+ LOOP 2DROP ;
<veltas> Is the best I can come up with and that is exactly what they suggested, but with ROT ROT instead of -ROT
<veltas> I do agree that anything significantly longer is bad forth
<veltas> WilhelmVonWeiner: I don't know I don't really take any standards seriously
<veltas> I like Forth's standard because it only seems to take itself so seriously and has let everyone get involved
<veltas> But I don't know much about the committee
_whitelogger has joined #forth
[1]MrMobius has joined #forth
MrMobius has quit [Ping timeout: 240 seconds]
MrMobius has joined #forth
[1]MrMobius has quit [Ping timeout: 265 seconds]
[1]MrMobius has joined #forth
MrMobius has quit [Ping timeout: 265 seconds]
[1]MrMobius is now known as MrMobius
deesix has quit [Ping timeout: 268 seconds]
dddddd has quit [Ping timeout: 260 seconds]
deesix has joined #forth
dddddd has joined #forth
mykespb has joined #forth
mtsd has joined #forth
WickedShell has joined #forth
X-Scale` has joined #forth
X-Scale has quit [Ping timeout: 255 seconds]
X-Scale` is now known as X-Scale
jfe` has joined #forth
jfe` has quit [Ping timeout: 240 seconds]
jfe` has joined #forth
MrMobius has quit [Ping timeout: 265 seconds]
MrMobius has joined #forth
mtsd has quit [Remote host closed the connection]
mtsd has joined #forth
mtsd has quit [Remote host closed the connection]
mykespb has quit [Quit: Leaving]
jfe` has quit [Ping timeout: 256 seconds]
gravicappa has quit [Ping timeout: 268 seconds]
dys has joined #forth
xek has quit [Ping timeout: 265 seconds]
<remexre> might've asked this before, but is there a word FOO such that for a non-immediate word BAR, in compile mode, FOO BAR is equivalent to ['] BAR COMPILE, ?
jhei has quit [Remote host closed the connection]
jhei has joined #forth
guan has quit [Remote host closed the connection]
arrdem has quit [Remote host closed the connection]
guan has joined #forth
arrdem has joined #forth
rann has quit [Remote host closed the connection]
ovf has quit [Remote host closed the connection]
ovf has joined #forth
rann has joined #forth
[1]MrMobius has joined #forth
MrMobius has quit [Ping timeout: 255 seconds]
[1]MrMobius has quit [Ping timeout: 240 seconds]
MrMobius has joined #forth
jfe` has joined #forth