00:00:00 --- log: started forth/19.11.21 00:00:05 yeah, I'm reading it now 00:00:13 the register names are familiar from x86, at least 00:01:22 ARM registers? 00:01:35 er the UART registers 00:02:12 ah. i haven't looked at the UART drivers for the imx6 in too much detail. the chip itself has a giant reference manual, but not all ARM boards have that so often you have to rely on reading other people's drivers 00:02:13 like "Line Status Register," "Modem Status Register," etc 00:02:49 yeah, I'm using the rk3399, so I've got an 824-page manual 00:03:05 and debian support 00:03:23 oh you should be all set then :) 00:03:45 if you have the schematics for whichever board you're using that should help 00:04:54 the canonical source of device trees is usually whichever kernel you're using. if it's mainline, then linux's source code 00:05:23 u-boot copies them and strips them down for its early boot purposes 00:06:22 looks like I've got schematics, though I don't know how to read them and there's a nontrivial amount of chinese 00:06:55 you probably don't need them unless you're trying to verify which pins are connected/muxed 00:07:56 the muxing/pin info is in the device tree for your board anyway 00:08:28 that'd be like, "to use device register needs bit # set" ? 00:08:50 yes and no, device trees are meant to be descriptive. so a mux looks like 00:08:53 let me find an example 00:10:00 --- quit: dys (Ping timeout: 250 seconds) 00:10:09 --- join: mtsd joined #forth 00:10:27 http://ix.io/22pj 00:11:12 with the uart using it like so: http://ix.io/22pk 00:12:28 not sure how to read this tbh; time to do some reading I guess 00:12:56 http://ix.io/22pl clarifies it heavily 00:13:28 for the rk3399 i'm sure it's something different and maybe a bit saner 00:14:04 oh ew these use the C preprocessor? 00:15:00 yep, device trees have their own compiler and it's kinda trash but at runtime it's just a flattened tree in memory 00:15:37 so I guess I'll have my own notation in my notes... 00:16:11 probably bc I work in a lisp shop, but it annoys the heck out of me that new tree-structured data formats are invented when sexprs exist... 00:16:34 ylatest device tree expr is at https://github.com/devicetree-org/devicetree-specification/releases/download/v0.2/devicetree-specification-v0.2.pdf 00:17:15 ok, thx 00:17:54 so this'd be like (for that uart), to enable the transmit pin do "*0x164 |= 0x2" (in pseudo-C) 00:18:46 yeah basically. just set the system on a chip's pins to mux according to the device tree, then whatever the uart block needs for initing (if it hasnt been already) 00:18:46 or I guess more like "setReg(0x164, getReg(0x164) | 0x2)" 00:18:57 ok, cool 00:19:03 you may be able to just get away with avoiding hardware setup if u-boot has already set up your uart 00:19:25 u-boot does not clean up its initialization before booting 00:19:38 huh, not sure how I feel about that 00:19:43 I guess short-term, makes my life easier 00:19:57 the device trees are often explicitly written so you can re-init the system 00:20:05 so all the pin muxes are provided 00:20:34 linux for example re-inits everything 00:21:22 but u-boot does do things like init DDR and MAC addresses which is useful 00:21:27 okay, I might after I get some stuff working, heh 00:21:54 probably don't want to mess with any of that until I have a working forth repl over serial though 00:22:10 one thing u-boot does that might actually mess with you is keep the instruction + data caches enabled- i'm not sure if this is of concern, but this breaks *BSD booting 00:23:08 huh, weird; is there not just like a "flush i/dcache" instruction? 00:23:18 and what are they doing that depends on not having caches o_O 00:23:31 i have no idea, it's weird 00:23:38 u-boot has the ability to disable them before boot 00:23:44 so they patch u-boot to do that 00:24:07 this is maximally spooky... 00:24:25 here's the u-boot boot spec that most modern u-boot's (2014 onwards) conform to: https://github.com/u-boot/u-boot/blob/master/doc/README.distro for your uses it would likely be you writing a u-boot script and puttig it on storage as 'boot.scr' 00:24:28 with forth (assuming DTC), do I need to do anything weird with the icahce? 00:25:05 probably not 00:25:55 but you can write a u-boot script that disables/sets up things using u-boot's commands before you load your binary 00:26:11 ok 00:27:00 i'm not entirely sure how u-boot passes the device tree to your binary, i think if you write an ELF binary you can specify an entry point 00:27:10 but you can also just check what the value is on your board and use that for now :P 00:28:07 yeah, doc/arch/arm64.rst was unhappily thin on details... didn't think to check for ELF-specific stuff 00:28:14 I'll probably hardcode for hello world, yeah 00:28:30 or maybe even skip the device tree and hardcode the register numbers and such too 00:28:51 yeah that's fine too 00:28:59 device trees are only there for portability 00:29:36 arm64 does have ACPI i think 00:29:54 but you might need EFI for that, i'm not sure 00:29:54 ehhhhhhhhhhhhhh 00:30:00 I'll take a hard pass on acpi... 00:30:04 haha 00:30:20 like implementing ACPI just seems pointlessly difficult for no reason 00:30:22 actually, arm64 also has arm trusted firwmware 00:30:38 which is loaded as well as u-boot 00:31:03 I'm not familiar with that; is that like a TPM? or like another EFI-shaped thing? 00:31:37 i believe it's a bit like intel's PSP where it runs in a privileged mode and handles power stuff 00:31:39 Mecrisp-Quintus 0.25 for RISC-V 32 IM on GD32VF103CB by Matthias Koch :) 00:31:42 https://github.com/ARM-software/arm-trusted-firmware 00:32:19 imho, arm64 really tries to get a more x86-like system 00:33:05 what's "secure world"? every google I tried for arm trusted firmware hit it (as did that link) 00:33:24 oh wait I can google it lol 00:33:33 I should prooooooooooobably get sleep at this point 00:33:42 'secure world' is just a mode in arm's trustzone which is very vague on details 00:33:51 the best explanation i've seen is https://genode.org/documentation/articles/trustzone 00:34:09 opening the page it has basically a diagram that explains it all 00:34:41 it's mainly used for DRM and security modules on phones 00:35:33 yeah, doesn't seem useful for anything I'd wanna do 00:35:45 i know for the imx6 at least you need some kind of NDA to read on how to initialize trustzone 00:36:08 I'm a compilers-head, so imo security should be obtained by requiring proofs of security properties in order to load programs :P 00:36:20 that's fair 00:36:40 i'm more of an 'isolation solves security' problem, but i think an MMU and microkernel basically solves that 00:37:26 problem with both ours (which I think/hope my model solves better) is confused-deputy sorts of things 00:37:41 capability-based security might help with that a bit? 00:37:59 I guess 00:37:59 there's a lot of effort spent on making systems like windows or linux which have bad security models be safer by just ... isolating those 00:38:25 but there's also nested hypervisors which is insane 00:38:58 I'm honestly suspicious of capability-based security's usability based on how much of a pain SELinux is, but if everyone in the ecosystem was assuming you'd need to ship whatever profiles looked like, then it seems like it'd be more usable 00:39:15 I dunno, I'm probably gonna end up with some flavor of capabilities 00:39:27 i wouldn't say SELinux is capability-based, though maybe i'm using the wrong term 00:39:37 right now I'm not thinking about it too hard, just making PIDs 64-bits to mitigate guessing 00:39:50 capability based where you can only use a resource if you have a token for it 00:39:57 a bit like file descriptors + passing those around 00:40:56 you ask a service for a handle, and after security checks you get the handle and can use it 00:41:13 SELinux/AppArmor are just weird hacks to try and curtail Unix's ambient authority 00:41:19 oh, I think I was thinking about it wrong 00:42:06 64-bit PIDs are pretty good if they aren't re-usable 00:42:18 unix's re-usable PIDs is such a headache :( 00:42:37 in my amd64 version, they're not, but that's the result of a resource leak bug :P 00:42:46 ah 00:43:21 the problem with re-usable PIDs is the race condition it gives where you can create a process, get pre-empted, have that process killed and replaced, then get pre-empted again and then try and use that process by its PID and its a new process 00:43:21 I'll probably make them non-reusable, but I need to figure out how I want PIDs to work with multi-machine setups 00:43:34 yeah 00:43:58 'cause like ideally I'd be able to IPC over the network with the same syscalls, just way higher latency 00:44:09 theoretically its solvable if you let processes lock PIDs 00:44:22 but i guess nobody wants that 00:44:34 yeah, that sounds like more trouble than its worth 00:44:45 actually, that 'locking' of PIDs is what init does on linux- init has to wait PIDs before they're reclaimed 00:44:55 so if every process had to wait() for its children that would solve the issue 00:45:09 but then you have stupid issues like double forking that destroys that 00:45:34 my hatred for unix runs deep as you can tell ;) 00:45:53 yeah, I'm not thrilled either 00:46:09 I suspect that I'll like Redox once I give it a try 00:46:26 my favorite unix fun fact is that if you don't have a controlling terminal (like a daemon), open()ing a file that is a terminal will set it as your controlling terminal UNLESS you pass NO_CTTY 00:46:38 :/ 00:46:49 I read an article about how the linux tty subsystem worked 00:46:55 got abt 2/3 of the way through 00:47:03 had to leave to go drinking 00:47:28 i was debugging DOSBox which happened to support using ptys to emulate serial connections 00:47:41 and i found that there's a TTY flag you can use to escape errors and ugh 00:48:18 as in to be able to send errnos as part of the stream or something? 00:48:23 fork() is also the worst 00:48:56 i think it was to send control characters for TTYs, such as resets 00:49:07 so the 0xFF character becomes an escape char 00:49:24 so you now have to check if a char is 0xFF then read the char after that for info 00:49:30 ah 00:50:30 i think it was actually used for parity or something 00:51:59 I've got to get to bed now (work in 5 hours); thanks for all the help and the great convo! 00:52:06 np, see you around 00:53:06 btw if you're the Linux maintainers and you really don't want people to grep for why code is checking for 0xFF, make sure to use \377 as your literaly 00:53:13 literal* 00:54:32 and especially don't document any of this anywhere useful 00:55:51 to be fair http://man7.org/linux/man-pages/man3/termios.3.html documents it but wow. ok im done 01:11:11 --- quit: Jookia (Ping timeout: 260 seconds) 01:13:31 --- join: Jookia joined #forth 01:49:07 --- quit: proteus-guy (Ping timeout: 265 seconds) 02:27:28 --- join: dave0 joined #forth 02:29:57 --- join: proteus-guy joined #forth 02:45:19 --- join: dddddd joined #forth 02:59:14 --- join: iyzsong joined #forth 03:12:15 --- quit: mtsd (Ping timeout: 265 seconds) 03:34:11 --- join: mtsd joined #forth 03:54:32 --- quit: mtsd (Remote host closed the connection) 03:55:47 --- join: mtsd joined #forth 04:01:04 --- quit: jsoft (Ping timeout: 265 seconds) 04:03:15 --- quit: dave0 (Quit: dave's not here) 05:59:23 --- quit: reepca (Remote host closed the connection) 05:59:59 --- join: reepca joined #forth 06:00:11 --- quit: iyzsong (Quit: ZNC 1.7.1 - https://znc.in) 06:03:35 --- quit: inode (Quit: ) 06:08:55 --- quit: Jookia (Ping timeout: 260 seconds) 06:10:40 --- join: Jookia joined #forth 06:21:57 --- quit: reepca (Remote host closed the connection) 06:22:31 --- join: reepca joined #forth 06:32:30 --- quit: reepca (Read error: Connection reset by peer) 06:33:12 --- join: reepca joined #forth 06:51:41 --- quit: reepca (Remote host closed the connection) 06:51:55 --- join: reepca joined #forth 06:52:03 oh, Jookia: now that I'm well-rested (well, better-rested), I remember the point of the SELinux comparison 06:52:19 the policy for what processes can request handles to what needs to live somewhere 06:52:47 and the finer-grained it is, the more annoying it is to get working with a large body of software 06:54:04 --- quit: mtsd (Quit: Leaving) 07:03:24 --- quit: reepca (Ping timeout: 250 seconds) 07:46:44 --- quit: tabemann (Ping timeout: 250 seconds) 07:54:26 --- join: dys joined #forth 08:00:36 --- quit: dys (Ping timeout: 250 seconds) 08:42:47 --- join: inode joined #forth 10:25:32 --- join: dys joined #forth 10:52:34 --- join: WickedShell joined #forth 10:53:08 --- quit: dys (Ping timeout: 252 seconds) 11:03:30 --- quit: inode (Quit: ) 11:17:20 --- join: dys joined #forth 11:30:34 --- quit: gravicappa (Ping timeout: 265 seconds) 12:26:46 --- quit: jimt[m] (*.net *.split) 12:26:47 --- quit: Jookia (*.net *.split) 12:26:47 --- quit: oxford (*.net *.split) 12:29:13 --- quit: diginet2 (Ping timeout: 240 seconds) 12:29:33 --- join: diginet2 joined #forth 12:35:59 --- join: ryke joined #forth 12:36:57 --- join: Jookia joined #forth 12:38:47 --- join: oxford joined #forth 12:46:14 --- join: dave0 joined #forth 12:51:19 remexre: yeah 13:05:48 --- join: Keshl_ joined #forth 13:07:55 --- join: X-Scale` joined #forth 13:09:20 --- quit: Keshl (Ping timeout: 268 seconds) 13:10:53 --- join: rpcope- joined #forth 13:12:39 --- quit: rpcope (Ping timeout: 240 seconds) 13:12:40 --- quit: X-Scale (Ping timeout: 240 seconds) 13:12:43 --- nick: X-Scale` -> X-Scale 13:23:31 my stupid math tweet just got liked by a guy who's got a fields 13:23:35 how cool is that 13:24:26 pretty cool! 14:10:24 --- quit: jedb__ (Read error: Connection reset by peer) 14:10:27 --- join: jedb_ joined #forth 15:06:10 --- quit: xek_ (Ping timeout: 246 seconds) 15:18:18 --- join: z0idburg joined #forth 15:18:23 Hello everyone 15:19:19 g'day z0idburg ! 15:20:06 I've been testing out various forths on this old box of mine 15:20:34 cool, hows the testing going ? 15:20:45 Though some of them feel broken or just not working due to possible misconfiguration maybe, not sure. Some just lack the documentation I wish it had 15:20:46 eh 15:21:36 which ones have you tested so far? 15:21:50 --- join: jedb__ joined #forth 15:22:23 So far, I have gotten pygmy, gforth, figforth, and in the past I tested this4th but I can't find it anymore 15:22:34 I can't remember if I have played any any others on this 15:23:06 the funny thing about pygmy is that it lacks a do word, and I couldn't find any alternative name for it 15:23:27 I wasn't very inclined to write one myself with concern of "who knows what else is missing" 15:24:19 --- quit: jedb_ (Ping timeout: 240 seconds) 15:25:15 My requirements are kind of narrow I'd have to say. Perhaps unnecessarily. First of all, I don't have my system configured to run 32 bit software yet, so my limitation is that it has to be 16 bit. But second of all, I need an assembler 15:25:49 UNLESS there's one that has words to help me call interrupts 15:26:23 Do any of those forths allow you to write inline assembler? 15:26:42 so pygmy supposedly does, gforth can, I am unsure about fig16 15:26:51 this4th no idea 15:27:09 Because if none of them have high level words for interrupts, that would probably be the only way to do it 15:27:24 gforth has a neat way of doing it, so I can be like, code foobar .w bx .w ax mov and it will translate it fine 15:27:57 oh nice 15:28:03 though I did test that and I think mayyybe I am expected to do some cleanup because after foobar compiles with end-code it says invalid memory address when I call it 15:28:38 maybe it expects me to fix the return stack for it possibly without doing so itselfno idea 15:28:44 you might have to save registers on the stack before you return 15:28:50 right 15:29:09 does gforth specify any kind of abi or anything? 15:29:21 It's funny because I am much more skilled at 6502/65816 than I am x86 assembly 15:29:27 hmmm 15:29:35 same for me 15:29:39 I haven't checked yet 15:29:46 Although, 6502 was designed to be written by humans 15:29:49 x86 not so much 15:30:21 or at least, not in its current iteration 15:30:51 I'm mostly just doing this for fun, but here's what happened. I discovered that DOS (I am using 16 bit FreDOS on a Pentium II) doesn't have many MUD clients and the ones that exist are awful 15:31:35 So I decided, WATTCP isn't that hard to work with, so why not try playing with WATTCP in Forth right? Because meh I don't want to use C for something nonserious and the WATTCP BASIC lib... yeah nevermind :D 15:32:09 hence the need for interrupts 15:32:58 You know I never did see if there was any wattcp forth libs 15:33:11 I assumed, "Nope." 15:34:39 --- quit: ryke (Ping timeout: 240 seconds) 15:35:57 crc: have you experienced any really bad perf issues with a bytecode VM? 15:41:53 i'm really considering moving from ITC to bytecode 15:47:22 Going to test some things, can only run one program at a time! I'll be around 15:47:24 --- quit: z0idburg (Quit: z0idburg) 16:03:17 --- join: rdrop-exit joined #forth 16:12:14 c[] 16:13:52 rdrop-exit, g'day Zenforth Master! 16:14:11 https://mecrisp-stellaris-folkdoc.sourceforge.io/gd32vf103.html#gd32vf103-longan-nano 16:14:44 hi Master Technician (tm)! 16:14:53 I've started porting stuff from the STM32F103 to the new RISC-V that uses the STM32F103 peripherals 16:15:43 tp: oh, i've heard about that. isn't that pin compatible? 16:15:50 cool, reading it now 16:16:04 one thing I don't yet understand is why the gd32vf103 has changed all the names of the peripheral registers when the ones I've looked at have identical bitfields 16:16:45 maybe to avoid being sued too bad 16:16:56 Jookia, I havent got to looking at the pin compatibility yet 16:17:13 Jookia, I guess there are many possible reasons 16:17:36 I do know that the actual die copyrights for the STM32F103 have expired now 16:17:41 what's your opinion on risc-v? 16:18:22 Jookia, I can only give an opinion regarding Forth on it compared to the STM32F103. I like it, it's pretty fast, and very cheap 16:18:44 but Ive still got a way to go porting my apps over 16:18:50 and my development system 16:19:20 FLASH.. TOTAL REPORTED: 131072 USED: 83308 FREE: 47764 16:19:20 RAM.... TOTAL PRESET: 32767 USED: 13675 FREE: 19092 16:22:15 I've become used to a small and easily install-able arm-none-eabi but the RISC-V toolchain is MASSIVE 16:22:38 'Kernel power consumption Only 1/3 of the traditional Cortex-M3' wow 16:22:59 claimed ... 16:23:08 yeah 16:23:25 and thats hard to measure, plus the board has no handy jumper to make that easy 16:23:41 but for $5 inc c color tft ... 16:23:53 cant complain really 16:24:33 there are other more developer friendly gd32vf103 boards around 16:25:07 the longan-nano is tiny, hard to even press the buttons with the nails on your fingers 16:25:26 but I think they will sell millions of them 16:25:58 a $5 voltmeter inc display ? perhaps a ampmeter, temperature guage, the list is limitless 16:25:59 i hope so 16:26:15 ill be really surprised if they don't 16:26:24 i was originally writing my forth for risc-v 16:27:06 what happened ? 16:28:04 i wrote it for ARMv7 instead because that's what runs on my computer atm 16:29:34 ARM's assembly is fairly similiar 16:30:27 64 bit ? 16:30:39 nah, 32-bit 16:30:42 i haven't messed with aarch64 yet 16:31:52 i'm under the impression it's a lot better than armv7 16:31:55 or, more RISC 16:35:01 i havent messed with it either 17:04:17 --- join: X-Scale` joined #forth 17:05:15 --- quit: X-Scale (Ping timeout: 245 seconds) 17:05:16 --- nick: X-Scale` -> X-Scale 17:05:47 --- join: tabemann joined #forth 17:30:01 hey guys 17:32:13 hey tabemann ! 17:37:14 I ran into a stupid bug 17:37:33 apparently sending exceptions to tasks doesn't always work 17:38:02 so in my ctrl-C handler, when it sends an abort exception to the main task, it sometimes goes bezerk 17:38:38 my ctrl-C handler works fine without it 17:38:50 except then it cannot stop errant behavior in the main task 17:40:16 on another note - my daughter is learning to program in school - but she doesn't know the name of the language she is programming in - when I asked her she just said "English" (I told her to show me it when she is over next) 17:40:27 hahah 17:41:21 hi tabemann :) 17:41:30 hey rdrop-exit 17:41:46 probably Python as that's the current "in" programming language 17:42:02 it used to be Java 17:43:15 ohboy, this is a fun thing to do 17:43:18 git clone --recursive https://github.com/riscv/riscv-gnu-toolchain 17:43:41 that gets you everything I presume 17:43:56 this has been running for about 16 hours 17:44:01 yeah, I guess so 17:44:25 it just trickles in 17:44:29 I wouldn't be surprised if it ran another 16 hours 17:44:36 gees 17:45:20 not something to do when you're not guaranteed a constant internet connection for a long period of time 17:45:29 I'm so used to arm-none-eabi loading in about 3 minutes 17:51:26 Why do you need the ARM gnu toolchain? I thought you now had a tethered version of Mecrisp-St 17:54:38 I just realized why the SIGINT handler sending an exception to the main task isn't working 17:54:53 it works just fine when something is making the main task spin 17:55:02 but when the main task is idle it makes it go crazy 17:55:10 the reason is simple 17:55:17 the main task is asleep 17:55:23 waiting on IO 17:55:37 seems simple when you put it that way :) 17:55:47 the actual task that is active is the sleep task, which is waiting on poll() 17:56:09 the SIGINT wakes up the runtime and breaks it out of poll() 17:56:39 then the SIGINT handler sends an exception to the main task, and the sleep task passes control onto it 17:56:45 rdrop-exit, i have both tethered and hosted on chip, and they both need the ARM GNU toolchain to be built 17:56:50 but the main task isn't expecting an ABORT exception 17:57:14 rdrop-exit, in this case tho, it's the gnu RISC-V toolchain I'm trying to download 17:57:33 it's expecting IO 17:57:56 it's not written to handle this use case 17:58:09 tabemann, so write it ? :) 17:58:12 tabemann, are you expecting your targets to all be POSIX? you seem to be adding more dependencies on POSIX being present 17:58:42 rdrop-exit: no I'm not - when I get around to working on uhashforth, I'm going to strip all that out 17:59:03 fun fun fun 17:59:19 there won't be any SIGINT obviously 17:59:43 rdrop-exit, in the case of Mecrisp-Stellaris I modify the serial handling, USART used and a few small things differently to the default binary 17:59:43 and I'm going to remap the interrupt mechanism to use ARM processor interrupts 18:00:35 tabemann, the last issue that Matthias has to finish is the GD32VF103 interrupt handling 18:02:04 I bet I could do something like tie the pushbutton on the disco board to one of my interrupts 18:02:23 so instead of pressing ctrl-C you push the button 18:03:40 sure, the 'user' pushbutton is available 18:06:01 I was running a primes generator test yesterday on my dev stm32f103 and wanted to read the local temperature but didnt want to stop the test, then remembered the temperature sensor reading is triggered by a pushbutton using a interrupt as well as the terminal which was locked out while the primes was running 18:06:37 I could actually implement multiple behaviors depending on different ways you hit the pushbutton 18:06:39 i presses the pb and bingo, the terminal printed the temperature. The primes test finished 45 minutes later 18:07:15 it's 32,81 C or 91,06 F here atm 18:07:20 like it only does the SIGINT handler if you press the pushbutton five times in a row in quick succession 18:07:39 thats easy to do 18:10:13 yeah 18:11:10 okay, I think I've got a fix to my to my ctrl-C issues 18:11:26 put a flag that indicates if it is currently in the line editor 18:11:45 and it only sends the exception if it is not currently in the line editor 18:12:16 it seems strange that you would still require the GNU toolchain once your host is up, I don't think Forth Inc's SwiftX for ARM requires it, don't know that for a fact though 18:14:16 I only need it when I modify the core of Mecrisp-Stellaris 18:14:24 after that I dont use it 18:16:06 tabemann, you could just turn off Ctrl-C SIGINT generation and handle the ctrl-C in your FORTH directly like any other key input 18:16:10 it's true that I achieve my mods in Forth alone, but that takes up flash space, so I modify the core with assembly 18:17:52 (by setting BRKINT mode control flag off) 18:20:28 tp, in theory once you have a Forth up on the host, that can talk to and lay down code on the target, you (in theory) needn't depend on GNU tools from that point on 18:21:13 back 18:21:38 tabemann, see my reply to you on ctrl-C 18:21:53 the reason why I'm not handling ctrl-C like other input is that I want to be able to use it when the main task isn't accepting input 18:22:08 for what? 18:22:22 the point is to be able to stop everything but the line editor 18:22:57 I don't get it tabemann 18:23:18 I should get another coffee, maybe that'll help 18:23:19 so I can do something like write : foo begin ." * " again ; foo ... and then it ctrl-C and I'm *bang* back at the line editor 18:23:20 brb 18:23:50 it's like ctrl-reset on the old apple //e 18:24:58 that if you have other keystrokes pending when you *bang*? 18:25:59 *what if... 18:26:55 as implemented it won't stop the line editor if it's currently running 18:28:34 On my host I just disable BRKINT and ISIG, all keyboard input comes through key 18:30:22 All key mapping and ignoring mode control flags are also disabled 18:30:24 I do have a potential solution to my issue - I don't put my line editor in the main task 18:31:10 and then I can handle ctrl-C in the line editor 18:31:29 found a web emulator for c64 18:31:43 and then found two forth in its list 18:31:52 it's amazing that JS can now run faster than hardware these days 18:32:06 https://floooh.github.io/tiny8bit/ check it 18:32:18 like the TI emulator I think siraben showed me 18:32:21 How many tasks are you running at startup? 18:32:31 just two - the main task and the sleep task 18:33:07 so the forth in c64 dont have words, how can i exploring it? 18:34:48 I don't really have a line editor on my Forth, since it's not a line-at-a-time Forth 18:36:57 yunfan, try VLIST 18:37:19 that was the WORDS equivalent in FIG 18:38:29 rdrop-exit:vlist gave a one line output 18:38:37 24cc disco 18:38:52 https://floooh.github.io/tiny8bit/z1013.html?type=z1013_64&file=z1013/z1013_forth.z80 try you self :D 18:39:30 Whoa, Z80! 18:41:17 tabemann: how's token threading for you? 18:46:33 back 18:47:35 it's slower than native code, of course, but it allows abstracting away the identity of words from their actual definitions 18:47:54 one downside is I have to decide ahead of time a maximum number of words supported 18:48:05 so I can allot a table containing every possible word 18:49:26 well, not the code for those words, but the code pointer and what I call the secondary pointer (the pointer to the tokens defining the word itself if it isn't a primitive) 18:50:41 (the code pointer is a pointer to a native code routine which implements primitives, or in the case of colon words, docol 18:56:21 its really cool that you could still use these forth word in a z80 simulators 18:56:33 sounds like you had connect to the history 19:02:43 I don't miss FIG-Forth 19:03:52 okay, I've gotta go - coffee shop is closing - will be back relatively soon 19:04:02 cya 19:08:46 --- quit: tabemann (Ping timeout: 265 seconds) 19:09:04 I like the two extremes, subroutine threading with inlining, and bytecode (8 bit tokens) VMs 19:11:21 The nice aspect is you use each on its own, or layer the two. 19:11:42 I don't ITC or DTC anymore 19:12:09 * ... you can use ... 19:15:51 STC+NCI for speed, bytecodes for portability and/or size 19:22:03 Combining the two allows you to have peephole optimization on the bytecodes, sort of a middle of the road between the two extremes. 19:26:56 Well suited to some PC based programs, where speed isn't critical, like an IDE. 19:27:42 where did everybody go? :) 19:31:00 --- join: X-Scale` joined #forth 19:31:07 --- quit: X-Scale (Ping timeout: 246 seconds) 19:31:35 bak! 19:31:41 wb! 19:31:49 --- nick: X-Scale` -> X-Scale 19:32:07 rdrop-exit, define "lay down code on the target" ? 19:32:46 rdrop-exit, youre right (of course) that I can do anything after the Forth binary is on the target 19:33:11 cross-assembly and/or cross-compilation 19:34:17 --- quit: WickedShell (Remote host closed the connection) 19:34:29 rdrop-exit, I cross compile the default forth target assembly to save code space and for convenience 19:34:59 even tho I can achieve the same thing from Forth on that same target 19:36:56 I was just puzzled on why you still needed the GNU ARM toolchain 19:37:34 i can see that 19:37:58 I receive the new Forth release as a binary, then test it on the target 19:38:38 but the author builds his releases differently to how I use them 19:39:31 as you say, I can alter what they do on the target purely in forth, but it's more efficient for me to alter the assembly and recompile 19:40:10 --- join: tabemann joined #forth 19:40:48 What I was imagining is that once he provided you with a tethered host version, you would put a new Forth on the target by using by using the tethered host rather than Gnu stuff 19:41:17 I only use the non tethered version at the moment 19:41:29 ok, got it 19:42:07 because the tethered version target is limited to MSP430 19:42:25 ah 19:42:27 and I use my large stock of STM3F051s 19:43:00 a excellent reason to use the tethered version is that the MSP430 has only 2kB flash 19:43:14 vs 64kB on the STM32F051 19:44:59 rdrop-exit, I expect that the longan-nano RISC-V boars will sell in the *millions* once all the 'arduinos' and so one get on board 19:45:04 Personally I'm not that interested in having a full Forth on the target (regardless of target size), just a monitor that works with the host to lay down code. 19:45:05 boards 19:45:33 sure, there are cases that suit each Forth 19:46:19 a tethered Forth really is a killer Forth for meany reasons 19:46:43 with the small binary advantage of C and the interactivity of Forth 19:47:03 agree wholeheartedly :) 19:47:29 in fact mecrisp-across (the msp430 tether) makes the same size binary "blinky" that I can in assembly! 19:47:57 My main question on RISC-V is how well will it cover the low end. 19:48:21 i think it will smash the low end for hobby 19:48:28 it probably already has 19:48:42 the same way ARM has? :P 19:48:48 What about the low-end for non-hobby? 19:48:55 yeah, moreso 19:49:04 back 19:49:11 in industry the low end is owned by PIC 19:49:15 wb again 19:49:17 welcome back! tabemann 19:49:49 and as PICs can be had for cents in the thousands, nothing will touch them for a long time 19:50:10 (in my opinion) 19:50:26 ok, thanks, appreciate your opinion 19:50:33 thats the absolute bottom end 19:51:01 stuff that goes into electric toothbrushes, gift cards etc 19:51:48 but once you get to IoT class which is massive now, I think RISC-V will be hard to beat, especially the Chinese variants 19:52:24 interesting times ahead 19:52:28 but what excites me about RISC-V isnt the price or market share, it's the possibilities 19:52:32 exactly 19:52:48 what if RISC-V does for hardware what Linux did for software ? 19:53:08 what are the possibilities ? 19:53:28 thousands of distributions? :-p 19:53:54 yep, all different in so way, utter chaos ;-) 19:54:46 I think it's hard to imagine what those possibilities may be 19:55:36 I see RISC-V as a enabling technology 19:56:28 And now you have OpenMIPS 19:56:39 too late? 19:56:52 (OpenMips) 19:56:56 I'm afraid so 19:57:47 seems that openmips is not quite openmips ? 19:58:02 and it's a bit too late imho 19:58:27 the cat is well and truly out of the bag with RISC-V 19:58:33 it's too bad MIPS wasn't successful in the long run, as it is quite a nice arch IMHO 19:58:48 tabemann, MIPS has been wildly successful 19:58:49 (I learned MIPS assembly in college) 19:59:12 Isn't RISC-V versy similar anyway 19:59:12 MIPS mcus are in every wifi ap 19:59:13 rdrop-exit: STC/NCI? peephole optimisation? 19:59:33 rdrop-exit, apparently very similar 19:59:34 I thought ARM owned everything but the very low end of the MCU realm these days 19:59:47 Subroutine Threaded Code (aka STC or SRT) 19:59:55 tabemann, no, MIPS has ruled in wireless for decades 20:00:05 rdrop-exit: oh, so just compiling call call call? 20:00:16 NCI = Native Code Inlining 20:00:19 tabemann, I dunno why 20:00:50 yes except in some cases, you inline the code instead of a call 20:00:59 (the NCI part) 20:01:05 i'm just using dumb ol' arm ITC because it doesn't require assembling at runtime 20:01:10 tabemann, ARM is huge in smartphones which is the first comms use I ever saw it in 20:01:58 probably because ARM is very low power for the amount of processing one can make it do 20:02:07 which is key in something like a smartphone 20:02:19 i cant wait to start doing some RISC-V assembly so I can compare it to M6800, MSP430 and Thumb 20:02:44 tabemann, yes, ARMS power control put it leagues in front of everything else 20:03:21 For short primitives it's a waste of space to call, so you just inline them 20:03:26 tabemann, my smartwatch has a ARM, gps, bluetooth, sensors, it's frigging amazing! 20:03:46 my watches have gears 20:04:01 rdrop-exit: ah, and so this would inline things like branching and addition to make some code that looks fairly native? 20:04:11 Im 101% smartwatch now, I'll have one till I die 20:04:40 yes, and once you have inlining, you can have peephole optmization 20:05:15 Many things are trivial when you use SRT/NCI 20:05:30 --- join: gravicappa joined #forth 20:05:34 e.g. tail-call optimization 20:05:57 i might try that some time 20:06:30 is there any advice on turnkeying that kind of thing? so compiling some words then dumping it to an executable 20:06:33 If you want maximum portability, the native code is no longer that of a real cpu, but of your bytecoded virtual cpu 20:06:59 interesting! so SRT/NCI but on a bytecoded virtual cpu? 20:07:10 or if you're doing a TTC implementation, everything is a token 20:07:12 Yes, that's what I use for my IDE 20:07:23 tabemann: how does that relate? 20:07:38 (SRT/NCI on a virtual CPU) 20:08:34 i'm trying to figure out if i want to keep doing ITC or not. i'm leaning towards the 'virtual CPU' solution because i really want to do sandboxing, and having a few clear native functions that can be called is what i want 20:08:45 Jookia: you don't CALL addresses, you just invoke tokens for the desired words 20:09:12 tabemann: ah yeah, that's a bit like ITC but more compact i imagine? 20:09:26 uh, direct threading 20:09:38 --- join: jsoft joined #forth 20:10:05 Just keep in mind that a fully sandboxed bytecoded CPU is super slow, so it's only applicable to certain scenarios 20:10:53 I use it for my IDE because as long as the screen refreshes are fast enough, I'm ok 20:11:06 rdrop-exit: wouldn't just making sure the only native code run is primitives be fine enough? though i suppose checks have overhead 20:12:02 my main issue i'm having is that pointers eat a lot of space and aren't relocatable, and machine words vary across platforms so i'm going to get different behaviour on integer operations 20:12:27 back 20:12:53 Jookia: it can be more compact because tokens can be smaller than addresses 20:13:04 like, say, you have a 64-bit system but 16-bit tokens 20:13:13 on 32bit it's fine so far but on 64bit systems it's almost ridiculous 20:13:54 with even a bytecode you need the byte for the bytecode, along with an address word for the destination, and also potential padding for alignment, just to CALL another word 20:14:02 You have to decide how far you want to go for the sake of portability, which OSes, endianess, alignment, etc... 20:14:15 so let's say you're on a 32-bit ARM system with a bytecode 20:14:35 and the current byte is at a 32-bit boundary 20:14:47 You don't need padding for alignment with a bycode call 20:15:05 rdrop-exit: that depends on your processor 20:15:12 but even without padding 20:15:14 It's not the native machine call, it's the VM's call instruction 20:15:33 you still need five bytes to call another word 20:15:43 whereas with a 16-bit TTC impl 20:15:47 you only need two bytes 20:16:09 yes, unless you have VM instructions for IP relative calls 20:16:54 You also gain back some of the space lost through inlining 20:17:50 and through the peepholing 20:19:12 another question, but how is turnkey forth done? do you specifically say which words and variables should be written to file? 20:19:18 The main difference is that with a bytecoded VM the only CPU specific Native code is in the VM not in the Forth 20:19:43 turnkey as in generating an executable for a desktop OS? 20:20:12 yes, or a mcu 20:20:40 just having a program that generates a program that contains only the words needed to run 20:21:47 If you don't want a whole Forth to be on the target than you use a cross-compiling Forth, preferably tethered. 20:22:16 dammit, gonna reboot - two whole cores are being taken up because the kernel is spewing messages really fast 20:22:30 bbs 20:22:35 e.g. https://www.forth.com/embedded/ 20:22:35 --- part: tabemann left #forth 20:22:55 rdrop-exit: ah, and cross-compiling to the same target would just be the same thing? 20:23:08 turnkey = cross-compiling to target? 20:23:12 uh, host 20:23:28 turnkey can mean different things 20:23:47 ah 20:24:06 Some Forths allow you to SEAL off the Forth so that the user doesn't have access to the whole underlying Forth 20:24:16 (but the Forth is still there) 20:25:37 If you want to generate target code that doesn't include a Forth, then you can use a Forth to lay down code to a target, either across a tether, or into a file. 20:26:29 Some Forths also come with utilities to strip out the headers, which reduces the size of final executable. 20:27:53 If you're just compiling a slightly different version of your existing Forth, then you use a meta-compiler. 20:28:43 lots of options 20:29:21 rdrop-exit, excellent advice! 20:29:31 yes, since plain Forth is interpreted, you have more scenarios then with a purely compiled language like C. 20:29:39 Thanks tp! :) 20:29:50 Python's solution is to just put the python code in a zip in the exe or something 20:30:18 my system uses a Word to write out the dictionary to the terminal in Intel Hex 20:30:36 Cool 20:31:16 For my uses (Unix tools) I'm pretty happy with just keeping the Forth VM + compiler/interpreter source + program source in the binary 20:31:29 i doubt i could even make an executable as big as GNU yes if i wanted :P 20:31:37 the terminal captures the iHex and uses DD to make a binary file of it. arm-none-eabi-objcopy then makes a cortex-m binary image 20:32:08 and that image is a total replica of the Forth project I just cloned 20:32:34 everything is automatic and orchestrated by a shell script 20:32:56 Jookia, you don't need to include the source if you don't want the user to have to waste time loading it 20:33:14 now thanks to rdrop-exits advice I can strip the headers to make a smaller image 20:33:21 :) 20:33:31 rdrop-exit: i'd rather just have it interpreted+compiled at runtime 20:33:33 --- join: tabemann joined #forth 20:34:08 --- part: tabemann left #forth 20:34:15 --- join: tabemann joined #forth 20:34:45 Another simple option is you make a copy of your Forth file, load the source for the app, save the whole thing. 20:35:34 it's a little wasteful to compile the entire program at boot, but it's still going to be probably 10x faster than shell scripts which load and invoke programs to do simple tasks 20:35:50 it also means i could add some kind of way to patch the source if modifications need to be made in production 20:36:17 it's such a headache to download a toolchain and dependencies and compile an entire project just to fix a bug 20:37:09 If you're going the virtual CPU route, you always have two files, the virtual CPU executable, and a bin file that it loads into its sandbox RAM at startup. 20:37:22 yeah 20:37:42 No recompiling of source necessary. 20:38:22 The bin file already includes the effects of that source. 20:38:32 for hashforth I have a compiled runtime and a relocatable image file which is relocated into the desired locations in memory when loaded 20:38:43 i'd rather just have it recompile at runtime and pretend it's some interpreted code 20:38:54 like python 20:38:55 note that the image file also can include forth source code which is compiled at runtime 20:40:05 Yes, my IDE's image file includes all the blocks, including the source. 20:40:52 Why blocks instead of files? 20:40:59 Besides the obvious hell that files are 20:41:02 The source has been precompiled into the dictionary RAM, but the source code is still there in blocks available for viewing. 20:41:12 Why blocks? 20:41:19 Simpler 20:41:37 Everything is persistent 20:41:43 I don't use blocks, I just take a bunch of files at the time the image is built and concatenate them together into one huge string 20:42:02 rdrop-exit: Persistent? 20:42:34 The IDE is persistent. 20:42:38 I think in rdrop-exit's Forth, edited blocks are written back to the image 20:42:58 rdrop-exit: How does that work? 20:43:07 The only persistent IDEs I've seen are Smalltalk's 20:43:55 Just to be clear, I'm just describing my *host* IDE, i.e. a program that runs on a PC, not a target Forth. 20:44:25 so your IDE edits blocks and those get sent to your target? 20:45:26 No these are the blocks of the IDE's Forth, nothing to do with the target itself. 20:45:58 Let me explain, hmmm 20:46:10 On my PC I only have two files 20:46:39 One is an executable, that's the VM of the IDE 20:46:58 One is a binary image of the content of the VM's RAM 20:47:52 When I run the VM executable as part of its boot, it loads the binary image file's content into its sandboxed RAM 20:48:27 The sandboxed RAM is just a series of 1k blocks 20:48:44 the first so many are the dictionary, the rest are storage 20:49:11 If I'm editing a block of source code, in the built-in block editor, and I 20:49:40 decide to take a brake, I save the image and shutdown the program. 20:49:58 I see 20:50:18 When I restart the IDE, the cursor will be where I left it in the editor. 20:51:05 That's what I mean by persistent, the whole VM RAM image is save back to disk (in the binary image file). 20:51:35 Ah I see 20:51:54 my Forth is similar, except it isn't sandboxed, and the image is relocated, and you can't take RAM and turn it back into an image after the fact 20:52:27 Since I don't have Gigabytes of blocks, saving the whole thing to disk is not a problem on a modern machine. 20:52:50 the reason for not sandboxing is that I intended on making it embedded and in that case I will want Forth to be able to address real memory 20:53:41 Since I'm up here in Unix land, everything shall be a file 20:53:58 Hmm, I wonder if I can shebang my VM ... 20:53:58 Even if I add assembler vocabularies for 10 different targets, and have 20 different projects going (hypothetical not a real possibility) everything's in that one image file. 20:54:01 my Forth, in its current incarnation, is able to access files as well 20:54:07 rdrop-exit: wow, nice 20:54:26 which I will strip out when I port it 20:55:36 yeah my forth doesn't work with shebangs yet 20:56:29 I switched to a file-based Forth for a few years, but I'm still most comfortable in a block based Forth. 20:56:49 I'm just wired that way. 20:57:42 I like Emacs too much to give up a file-based workflow 20:58:06 yeah i'm stuck with vim] 20:58:22 though if i make my own IDE that works better than vim, i'd be up for that 20:58:24 IIRC there are some Forths that have Emacs like block editors. 20:59:02 also blocks are too small for me 20:59:07 My block editor was recently retroffited with wordstar-like keybindings. 20:59:38 Too small? They're a whole kilobyte! ;-) 21:00:40 lol 21:02:14 Look how much free space 21:02:21 1kB is a HUGE amount in embedded 21:02:25 0 source VDT - Input - Keyboard Stream 2|2 21:02:25 1 21:02:25 2 : drain ( -- #|0 ) tty kib b/kib read ; compiled 21:02:25 3 21:02:25 4 : await ( -- # ) drain ?dup 0recur ; compiled 21:02:27 5 21:02:30 6 : sustain () undispensed ?; await retain ; compiled 21:02:32 7 21:02:35 8 : dispense ( -- b ) dispensed b@1+! kib or b@ ;inline compiled 21:02:37 9 21:02:40 a : key ( -- b ) sustain dispense ; 21:02:42 b 21:02:45 c 21:02:47 d 21:02:50 e 21:02:52 f 21:04:10 what does compiled mean? 21:04:14 my system is totally different, I didn't know much Forth when I started on it, so I went my own ay 21:04:16 way 21:04:38 That reminds me of a Fleetwood Mac song :) 21:05:01 :) 21:05:08 a great song that is 21:05:30 Jookia, compiled means the word only has compile-time behavior, no interpret-time behavior 21:06:17 ah 21:06:19 i.e. you can conpile it into a definition, but you can't run it from the keyboard 21:06:43 You'll get an exception if you do, slapping your wrist 21:07:18 I hust get a loud BEEP and a red "ERR" 21:07:21 just 21:07:39 red marks the spot 21:08:24 mine'll give you an exception and needlessly provide an exception trace 21:08:29 me too, except it's your wrist that's red ;-) 21:08:44 hahah 21:09:10 my errors theesedays a 99% typos 21:09:21 lunch is ready, catch you all later : 21:09:24 ) 21:09:27 :) 21:09:44 as I learnt my errors became dumber and dumber until only the really dumb ones remain 21:09:45 even BYE results in an exception trace, because I once was having problems with BYE occurring in unknown parts of the application, and I wanted to track them down 21:09:59 rdrop-exit, no problemo 21:09:59 see ya rdrop-exit 21:10:32 I have decided that only experienced coders are capable of mainly really dumb errors 21:10:48 and that beginners make the most complex errors 21:10:52 then I'm not an experienced coder 21:11:16 because I write bugs that require some thought to fix 21:11:24 sure you are, you made a really dumb error the other day 21:11:32 a beginner couldnt do that! 21:11:38 lol 21:11:59 yes putting the send-exception code in the alarm interrupt handler rather than the SIGINT handler 21:12:06 exactly 21:12:44 the more we know, the less complex errors we make, so the stupid ones become more common 21:13:05 which isnt to say that we dont spend a lot of time working out complex stuff 21:13:22 it's not that the stupid ones become more common rather than that they're the only ones left 21:13:54 I made a 'tracking filter' when I first started, I still dont know wether to be proud of it or ashamed .... 21:14:09 tabemann, exactly 21:14:51 10 constant sieve-size \ Reject variations of less than 10 21:14:52 0 variable oldinput 21:14:52 : sieve ( newinput -- output only if newinput = oldinput +- sieve-size ) 21:14:52 dup oldinput @ sieve-size - <= if 0 >r else 1 >r then 21:14:52 dup oldinput @ sieve-size + >= if 0 >r else 1 >r then 21:14:52 r> r> and if drop oldinput @ else dup oldinput ! then 21:14:55 ; 21:15:45 it works well but is a bit obfuscated to read 21:16:34 I use it to remove noise from analog to digital converters 21:16:43 it's a alternative to averaging 21:16:57 you're using 0 and 1 rather than false and true 21:17:06 semantics ? 21:17:22 you're using 1 as a boolean value 21:18:19 I must rewrite it sometime and see what I can achieve now 21:18:22 (I'm used to Forth code using -1 for true) 21:19:01 well -1 is just u of 1 anyway 21:19:31 i had a lot of trouble with -1 as true when I started using Forth 21:19:52 for me, 1 was true and 0 false, being a tech 21:20:16 a logic probe or scope sees 1 or 0, high or low, it never sees 'true' 21:20:39 true and false are programmer concepts 21:20:56 I fixed a bug today that was caused by my ORing together a bunch of bit flags and NOTing that, and using that as a boolean 21:21:16 typical :) 21:21:37 logic is a great opportunity for bugs 21:21:39 I had to add 0 <> to the function doing the ORing 21:21:51 to turn the value into an actual boolean 21:22:06 nothing like logic to confuse a human mind ;-) 21:22:18 the original problem was that no matter what the original value was, after NOT it would be treated as TRUE 21:22:24 I dont think of boolean, only 1's and 0's 21:22:25 by IF at least 21:22:34 hahah 21:22:36 oops 21:23:00 I used to think in hex back when I was doing tons of machine code 21:23:38 that was hard and boring work, when I got my first assembler, I thought Id died and gone to heaven 21:26:35 I guess I could never use blocks and a mcu based editor because I love having tons of comments in my Forth code 21:26:43 tables, notes, everything 21:27:04 my comments make up about 25% of my source 21:28:07 my problem is my words are just too damn large 21:29:34 a common issue 21:29:52 I think all forthers fight that problem 21:30:08 especially if coming from a C background 21:30:15 or Perl, or whatever 21:30:36 aaaagghhh 21:30:41 my 'sieve' word above is too large 21:30:52 just ran into a bug I saw before 21:31:02 after killing an errant word in the main task 21:31:10 it ends up using a full core 21:31:40 to make it not use a full core I had to execute 0 10000000 sleep 21:33:12 haha 21:38:00 fixed that bug 21:38:30 I bet there's more places in the code where lack of proper try/?raise will cause bugs related to ctrl-C 21:39:06 I know my IO code is like that, even though I've worked around it so that ctrl-C does not send ABORT exceptions to the main-task if it is waiting on IO 21:41:33 Forth is a lifes work 21:41:50 it keeps you outa trouble and off the street 21:41:51 even moreso when you have your own Forth 21:41:59 absolutely 21:42:11 Id need another whole life to make my own Forth 21:42:22 perhaps a bew religion is needed ? 21:42:25 new 21:42:33 the Church of Forth 21:42:34 back :) 21:42:42 wb 21:43:03 thanks, what'd I miss? 21:43:13 me fixing yet another bug in hashforth 21:43:23 good on you 21:44:18 the blessing's on you 21:44:22 In this one, lets call it "Forthology" God will return with his angels, the evil will be smited, and Forth programmers will live in peace with the animals laying peacefully on cool grassy fields with their heavenly million core laptops open and coding their own Forths ... 21:45:00 for eternity, which most of them, especially tabemann will need to get his Forth right 21:45:16 rdrop-exit, welcome back! 21:45:24 thanks tp! 21:45:30 hi phadthai ! 21:45:33 my forth is not of this world but a treasure in heaven 21:45:42 awesome 21:45:47 Hi phadthai 21:45:50 hello 21:45:56 hey phadthai 21:46:12 I should really get to bed soon 21:46:23 me too :) 21:46:27 00:46 21:46:50 thats about the average programmers bed time :) 21:47:21 g'night guys 21:47:26 gn 21:47:47 sleep tight tabemann, no dreaming of signal handlers 21:48:06 dreamstack underflow 21:48:34 I'll try not to dream of signal handlers :) 21:48:41 :)) 21:49:15 dream of short definitions 21:49:41 and all will be well 21:49:55 I see nightmares for tabemann of being stuck in a giant Forth CORE! 21:50:31 rdrop-exit, I started reading usenet inc CLF again this week 21:51:02 I fired up SLRN and found I now understand a LOT more of the dialog than I did 2 years ago 21:51:05 his dreams are directed by Hitchcock 21:51:25 "The Exceptions" ? 21:51:45 cool, the SNR in clf is bad, but I still check in once a week or so 21:52:17 "Preemption!" 21:52:27 or "Preempted!!" 21:53:26 The night of the Exception! 21:53:44 That's Hammer Films 21:53:54 rdrop-exit, I always used a 'scorefile' it makes fast work of noise 21:54:44 I'd forgoten how good Usenet is after a couple of years of HTMl forums 21:54:47 Nowadays I use Google Groups to read CLF, it sucks, but it's free 21:55:26 GG is very popular for sure 21:55:57 It freezes up all the time on Safari 21:56:10 I'm pleased to say that the the Longan-Nano board is no slug 21:56:30 good 21:58:53 but the cross compiler is the size of the universe! 21:59:08 im still downloading it! 21:59:20 gahh I hate git* 22:00:01 :)) 22:01:50 Just caught up on what I missed over lunch 22:02:05 Comments are not a problem on a block based Forth 22:02:40 they would be for me 22:02:45 You can use shadow blocks (for the what) and inline comments for the details 22:03:02 really 22:03:04 I know, my first ARM based Forth had blocks 22:03:18 yeah, I want my comments IN the code 22:03:44 --- quit: gravicappa (Ping timeout: 265 seconds) 22:03:45 Im peculiar that way I know 22:04:09 I only put certain types of comments in the code itself 22:04:20 I like blocks when I used them, they did seem natural at the time 22:04:31 I put everything I like in my code 22:04:37 The rest goes in shadow blocks, or a manual 22:04:47 tables, everything 22:05:26 0 preamble ASCII Table - 1|2 22:05:26 1 22:05:26 2 | .0 .1 .2 .3 .4 .5 .6 .7 .8 .9 .a .b .c .d .e .f | 22:05:26 3 ----+-------------------------------------------------+--------- 22:05:26 4 0. | ^@ ^A ^B ^C ^D ^E ^F ^G ^H ^I ^J ^K ^L ^M ^N ^O | 000.... 22:05:28 if your shadow blocks get lost, no doc and this has been a issue with blocks forever 22:05:28 5 1. | ^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^\ ^] ^^ ^_ | 001.... 22:05:31 6 2. | bl ! " # $ % & ' ( ) * + , - . / | 010.... 22:05:33 7 3. | 0 1 2 3 4 5 6 7 8 9 : ; < = > ? | 011.... 22:05:36 8 4. | @ A B C D E F G H I J K L M N O | 100.... 22:05:38 9 5. | P Q R S T U V W X Y Z [ \ ] ^ _ | 101.... 22:05:41 a 6. | ` a b c d e f g h i j k l m n o | 110.... 22:05:43 b 7. | p q r s t u v w x y z { | } ~ ^? | 111.... 22:05:46 c ----+-------------------------------------------------+--------- 22:05:48 d 22:05:51 they can't get lost they're in the same file (in my case) 22:06:03 --- quit: Jookia (Ping timeout: 260 seconds) 22:06:03 0 shadow ASCII - Control Character Constants 22:06:03 1 22:06:03 2 +---+---+---+----+---+---+---+---+---+--+---+---+--+--+--+---+ 22:06:03 3 |^@ |^A |^B |^C |^D |^E |^F |^G |^H |^I|^J |^K |^L|^M|^N|^O | 22:06:03 4 |00 |01 |02 |03 |04 |05 |06 |07 |08 |09|0a |0b |0c|0d|0e|0f | 22:06:05 5 |nul|soh|stx|etx |eot|enq|ack|bel|bs |ht|lf |vt |ff|cr|so|si | 22:06:06 cool 22:06:08 6 +---+---+---+----+---+---+---+---+---+--+---+---+--+--+--+---+ 22:06:10 7 |^P |^Q |^R |^S |^T |^U |^V |^W |^X |^Y|^Z |^[ |^\|^]|^^|^_ | 22:06:13 8 |10 |11 |12 |13 |14 |15 |16 |17 |18 |19|1a |1b |1c|1d|1e|1f | 22:06:15 9 |dle|dc1|dc2|dc3 |dc4|nak|syn|etb|can|em|sub|esc|fs|gs|rs|us | 22:06:18 a | |xon| |xoff| | | | | | | | | | | | | 22:06:20 b +---+---+---+----+---+---+---+---+---+--+---+---+--+--+--+---+ 22:06:23 c |^? | 22:06:25 d |7f | 22:06:28 e |del| 22:06:30 f +---+ 22:07:04 but that begs the question, why break a file up into smaller parts ? 22:07:13 Although lately I've been moving all the diagrams to the reference portion of the manual 22:07:33 random access 22:07:48 --- join: Jookia joined #forth 22:08:00 but it's the ONE file ? 22:08:13 each block is the same size, occupies the same space on the screen 22:08:18 you file system will see it as one file 22:08:40 I don't care about the file system, this is on the host 22:09:06 yeah, all my stuff is on the host. what goes to the target is stripped source 22:09:14 My editor always occupies the same portion of the screen 22:09:16 no comments leave the machine 22:09:44 No source leaves the machine 22:10:07 sure, but thats personal preference as your editor is PC based it could be Eclipse and a 500mB binary 22:10:38 no need for a pc based editor to be 16kB of efficient and limited assembly 22:11:03 my editor is part of my Forth 22:11:20 but your Forth is PC based, it has mega resources ? 22:11:48 This is SPARTA! 22:12:06 I had the impression blocks were designed for a simpler, quieter time when men killed men like gentlemen, with a stick or a rock in hand to hand slaughter 22:13:25 I simply cant own a Lambo and not do 200mph now and again 22:14:05 When I fire up my Forth IDE, it's its own little world, no external dependencies other than a handful of POSIX-compliant function calls 22:14:25 so my attitude is if I have a mega resource rich PC, I'll use it to the fulleffect to assist a older and simpler Forth on a Micro 22:14:59 it has one complex external dependency tho ... a modern PC ? 22:15:28 I bet it would run fine on a 10 or 15 year old PC 22:15:42 but I draw the line at editors like the java bloated Eclipse 22:15:54 or a RPI2 ? 22:16:01 my system would run on a RPI2 22:16:14 wouldnt be as fast in some cases but would be fine 22:16:16 I'm sure mine would too 22:17:09 the only slow bits would be one offs such as parsing a huge XML SVD file into Forth Words 22:17:11 Even for the terminal I use a very small subset of escape sequences 22:17:30 Gnu screen runs fine on a rpi2, Ive used it 22:17:41 I don't need Gnu screen 22:18:03 but I love the speed of this box, I own it, it's available 24/7 so I use it 22:18:15 gnu screen is a vital part of my DE 22:18:26 it wouldnt work without it 22:19:48 I don't need any external programs, it's all self-contained 22:20:06 2 files 22:21:04 mine is self contained too, if you define 'self' as a monster pc :) 22:21:20 The VM executable is in C, so I need a generic C compiler if I want to change the VM, but other than that nothing 22:21:54 mine is all script files and standard old unix utils plus the fossil SCM 22:22:23 in fact each project is *completely* contained in one file 22:22:50 No script files, I just start up the IDE VM at the command line 22:22:54 you could connect to it with fossil and clone it remotely, then upload changes and so on 22:23:41 well yours is much more complex, Ive just hooked up standard unix apps to work together using sh as a glue, as befits a tech like me 22:24:28 mine is like a lego crane, yours is a machined one piece crane :) 22:24:37 :) 22:24:42 or two piece 22:25:23 but I dont use anything complex or new, no Go, No Lisp, no Perl 22:25:39 I haven't used bash for anything non-trivial in years, I don't think I'd be capable anymore of doing any sophisticated in bash anymore. 22:25:48 just sh and the usual unix utils one every unix machine, sed, etc 22:26:11 I dont use bash for anything, bash is a Linux dependency 22:26:20 I just use sh 22:26:27 I use AWK once in a while, including for sed-like things 22:26:53 yeah I could use awk instead, I'm ok with sed for the simple parsing I do 22:27:17 Pretty much I limit myself to C, AWK, Forth 22:27:51 I havent done any proper C pojects for 18 years 22:27:59 --- quit: oxford (Ping timeout: 260 seconds) 22:28:27 i make up the occasional simple C project to familiarise with the state of things but thats all 22:28:55 I checkout MBED or platformIO, or whatever just so I know what they involve 22:29:13 rdrop-exit: i hope you're using terminfo for whatever curses stuff you're doing 22:29:16 and they are mega complex behind the scenes, like C really 22:29:23 C covers any POSIX programming needs, AWK for throw-away text processing, I've pretty much lost touch with the other languages I used to know 22:29:49 Jookia, no don't need terminfo or curses 22:30:10 for instance my micro hosted Forth receives and creates pc based files, but it has no idea it is 22:30:17 so there's no funky term stuff? 22:30:21 just line-based 22:30:22 --- join: oxford joined #forth 22:30:40 My Forth isn't line-based, it's full screen 22:30:50 how does it do that without terminfo/curses? 22:30:51 nice 22:31:11 the micropython editor is full screen and I'm a bit jealous 22:31:39 I use a handful of ECMA-48 compliant terminal control sequences, and 2 or 3 DEC VT control sequences 22:31:40 even tho I rarely use the terminal screen directly 22:31:50 basically lowest common denominator 22:32:01 simplest solution ? 22:32:07 yes 22:32:17 that sounds like kind of a headache 22:32:23 but also smart if it's portable between ttys 22:33:00 My screen is 80x24 8 colors, it'll run on pretty much anything 22:33:22 nice 22:33:31 why is it written in C and not forth? 22:34:16 --- quit: dddddd (Read error: Connection reset by peer) 22:34:45 The VM? Because it's for running on a POSIX OS, I didn't want to revisit x86 assembly 22:35:20 oh, so the IDE is in forth but the VM is on C? 22:36:40 Yes the VM is a virtual chip, it contains the fetch/execute cycle of the virtual CPU and the "microprogramming" of the VM instruction set. 22:37:15 When it boots up it loads the RAM image which has the metacompiled Forth in it. 22:37:30 what is metacompiling? cross-compiling? 22:38:36 It's a Forth term, it's like bootstrapping a new version of a Forth compiled from an older version of the same Forth. 22:38:50 ah 22:39:24 rdrop-exit, ahh, but where did the FIRST Forth come from ? 22:39:35 virginforth ? 22:40:17 It evolved, as Chuck rewrote his proto-Forth from job to job. 22:40:38 it's a fascinating story iirc 22:40:58 chuck wouldnt tell people how his Forth was made and for ages, no one knew 22:41:04 it was all commercial 22:41:18 no one knew how to bootstrap one 22:41:47 It's like the GCC developers compiling the source for a new slightly modified version of GCC on the immediately previous version of GCC. 22:42:07 sure 22:42:25 In computer science terminology our meta-compilation is their compiler bootstrapping. 22:42:32 wheras Mecrisp-Stellaris is just crosscompiled assembly 22:42:44 really 22:42:48 yep 22:43:10 i wonder why he didn't tell anyone 22:43:12 https://en.wikipedia.org/wiki/Bootstrapping_(compilers) 22:43:37 Jookia, chuck wanted to monetise his work like everyone else in those days 22:43:54 AT&T unix was $10k USD per seat back then 22:44:06 monetising compsci concepts too? 22:44:25 Metacompilation is one of the main strengths of Forth that was sort of forgotten with commercial Forths and ANS Forths 22:44:25 it was copyrighted work 22:44:34 tp: you can't copyright a concept 22:44:54 sure, but you can copywrite a work 22:45:01 and keep the concept secret 22:45:10 Hello there 22:45:14 yeah, so i wondered why he'd keep the concept secret 22:45:16 hi jsoft ! 22:45:25 Jookia, it's simple ... $$ 22:45:25 I need to have an 'array' of say, 24 bits * x 22:45:37 tp: yuck 22:45:42 I need to bit bang out each bit reasonably quickly. 22:45:48 What would you guys suggest I use ? 22:46:07 Jookia, chuck worked for a living, he had to eat, he had a family, he wanted recompense for his time 22:46:08 I am ultra virgin at forth 22:46:09 Most Forth vendors don't want you to metacompile, and ANS is too UNIX 22:46:34 tp: doesn't everyone? 22:46:42 jsoft, you;re not alone 22:47:01 what do you call the 24 bits? 22:47:15 23 bits plus 1 bit ? 22:47:18 ;-) 22:47:39 I call it the consortium of important and relevant bits 22:47:43 what do they represent? :) 22:48:04 They are 3 bytes which describe the PWM of an RGB led 22:48:08 Of which there are many leds 22:48:16 ok 22:48:32 : thingies ( # -- #' ) 3 * ; 22:49:07 :| 22:49:17 create thingie-board 100 thingies allot 22:49:36 :p 22:50:06 is that 2nd 2 last line a valid forth statement ? 22:50:14 sure 22:50:54 how about " create 7seg $3f , $06 , $5b , $4f , $66 , $6d , $7d , $07 , $7f , $6f , \ create 7seg led lookup table/array " 22:51:05 Hmm 22:51:14 just plug in your numbers ? 22:51:19 --- join: ryke joined #forth 22:51:29 thats a 7seg led array I use 22:51:50 I am going to be altering the values all the time 22:51:50 you need to use b, or c, depending on the Forth to comma a single byte into the dictionary 22:51:56 0 - 9 for the display 22:52:34 I just used cells, this was years ago 22:52:46 cells eh. 22:52:52 Cripes I've got a bit to learn 22:53:08 All right, so create thingie-board 100 thingies allot creates... what 22:53:12 it still works fine, a beginner may be confused by such terms as b or c and 'comma' ? 22:53:20 100 elements, each... what, each 32 bits? 22:53:55 --- quit: dys (Ping timeout: 276 seconds) 22:53:58 jsoft, the first thing to learn is that Forth is the ultimate chameleon and has almost unlimited solutions to every question 22:54:23 That's kind of why I started taking interest in it, but mostly because it was interactive and fits on uC's 22:54:24 in the code I posted 24 bits each, but if you don't mind wasting a little space make them cell sized, so you don't have to shift and or them 22:54:25 forth is as ubiquitous and granular as assembler but with actual semantics 22:54:29 jsoft, you could, it's a bit wasteful maybe, but as a beginner whats a little waste ? 22:54:54 which is why I love and hate it 22:55:05 if you're going to use cells, make sure the cells aren't just 16-bits on your Forth 22:55:10 ryke, Im finding that Forth and assembler are blending together for me thesedays 22:55:16 I don't even know what cells are 22:55:28 jsoft, whats your MCU ? 22:55:33 think of it as the word size of your Forth 22:55:35 F051 22:55:48 rdrop-exit, ahh gotchya 22:55:53 jsoft, a 'cell' is the native data size of the machine 22:56:01 So it should be 32bit for an stm32 right ? 22:56:11 Using mercrisp stargate 22:56:14 :D 22:56:29 a 6800 cell would be 8 bits, a MSP430 cell - 16 bits, cortex-M = 32 bits 22:56:37 right 22:56:47 mecrisp STARGATE !!! WTF ????? 22:56:55 Are you going to be loading and storing them 24 bits at a time? 22:57:03 tp, I know, I think it sounds better then stellaris or whatever the actual name is 22:57:05 it's not always the native data size for the architecture 22:57:13 jsoft, hahahaha, lol 22:57:20 ryke is correct 22:57:53 the forth I'm working on is for the 6502 which is 8-bit by nature, but for sanity's sake I still have cells as 16bit 22:57:55 jsoft, Matthias Koch is German and has his own very quirky German sense of humour 22:58:33 If you're going to be accessing that array 1 byte at a time than the solution I gave you is good enough 22:59:33 rdrop-exit, ok 22:59:44 It's also good enough for 24 bits at a time if you're willing to pack unpack the bytes when you read/write them 22:59:48 rdrop-exit, your solution is complex for a beginner, typical of a ZenForth Master! 23:00:09 I recommend a simple array laid out by hand 23:00:22 tp, what do you mean laid out by hand 23:00:27 if not then you're probably better off storing each 24 bits in a 32-bit aligned 32-bit cell and wasting the top byte of each cell 23:00:36 jsoft, like my example 23:00:52 tp, but i need to change eache byte in that array often 23:01:07 ie, via code 23:01:33 jsoft that doesn't matter, what tp is talking about is how you lay down the values in the dictionary 23:01:44 jsoft, then you better not listen to me, I'm only a beginner :) 23:02:18 that's what the comma-ing words in Forth are for, i.e. "," "c," "16," etc... 23:02:19 jsoft, rdrop-exit will always see the big picture, which is about 100x further than I can see 23:03:10 jsoft do you understand what "create" does in Forth? 23:03:17 jsoft, it took me a while to realise that arrays in Forth are so simple, just indexed memory locations 23:03:29 rdrop-exit, I had to look it up, but seems to attach a label to an address in memory 23:03:38 yes 23:04:04 yes, it reserves a space in memory assigning a label to the base location ? 23:04:18 base being the next free bit-o-memory? 23:04:24 no, it does not reserve it just labels 23:04:49 ahh, good point 23:04:50 rdrop-exit, does it incriment the 'base' value or wahtever to the address + alloc amount ? 23:05:12 jsoft, no you have to do that 23:05:34 the 'comma' does that ? 23:06:17 but the 'comma' can increment by different numbers of bits, for instance "c," is usually 8 bits 23:06:18 comma stores a cell at the current dictionary location, i.e. HERE, and advances 1 cell-width forward 23:06:45 "h," is a halfword, usually 16 bits on a cortex-m 23:06:52 advances HERE (really the what's stored in DP) 23:07:18 the comma words available depend on the Forth 23:07:33 as jsoft is using mecrisp-stargate I have a lot of experience with it 23:07:33 for example I use 16, for 16-bits 23:07:40 ah cool 23:07:56 jsoft, whats the actual MCU model ? 23:08:13 * tp guesses ... stm32f103 ? 23:08:51 so... the example code you showed would be allocating twice the amount of bytes needed for my case 23:09:03 tp, stm32f051 23:09:04 erm 23:09:18 oh awesome, my favorite mcu ever! 23:09:20 whose example 23:09:25 rdrop-exit, your example 23:09:45 no my example allots 3 bytes x 100 23:09:56 3 bytes i.e. 24 bits 23:10:19 ie one hundred 24 bit thingies ? 23:10:25 ok 23:10:36 so thingy is just saying times it by 3 23:10:49 actually I should say it allots 3 x 100 bytes 23:10:55 yeah, it's confusing when using arbitary sizes 23:10:55 yes 23:10:56 and alloc works with bytes 23:11:15 alloc is completly different, this is allot 23:11:21 sorry, allot 23:11:24 yes, allot works in bytes 23:11:30 Hmm 23:11:34 100 cells allot 23:11:47 would allot 100 of whatever your cell size is 23:11:58 jsoft a array is just a windows of memory, it's up to you how you access it 23:12:21 Riight 23:12:24 on a 32-bit system, e.g. : cells ( # -- #' ) 4 u* ; 23:12:38 jsoft, the big problem is if youre creative you may unalign locations and thats exception land 23:12:54 sorry 4 * 23:13:36 rdrop-exit, so not byte size, but cell size then 23:13:45 exactly, that's why you need to decide how you will be accessing them, and lay them out accordingly 23:14:14 or pack/unpack when you load/store 23:14:14 rdrop-exit, essentially i will be iterating over them to set their values, and the same to bit bang them out 23:14:23 Mecrisp-Stellaris will throw the endless Unhandled Interrupt 00000003 !' message if you unalign bytes 23:14:32 then use 32 bits 23:15:09 id say use cell size for now, as you learn it will become obvious how to improve your design 23:15:13 unless you're dying to save space 23:15:20 I have plenty of space 23:15:34 jsoft will have 64kB of flash and 8kB of ram ? 23:15:39 Yes 23:15:43 (the pack/unpack option isn't worth the trouble unless you have tons of wasted space) 23:15:58 jsoft, running at 8, 48, or 96 MHz clock ? 23:16:21 48 23:16:56 jsoft, whats your PC Os, what editor and terminal do you use, whats the baud rate and do you use end of line delays ? 23:17:10 ( a typical tp survey ) 23:17:36 tp, I am using loonux, and.. erm... 115200 with... 23:17:47 picocom ? 23:17:56 e4thcom or something 23:18:02 yeah that 23:18:03 ahh perfect 23:18:05 e4thcom 23:18:06 yu vill answer all our questions! 23:18:40 e4thcom is a purpose made Forth terminal with configurable color errors and error halting 23:18:50 You're an error halting 23:18:53 :P 23:18:55 oh that's neat 23:19:02 * tp can see that jsoft is well on the Forth path 23:19:03 never heard of e4thcom before 23:19:09 :)) 23:19:17 ryke, it's *perfect* for Linux users 23:19:37 I actually went back to linux because windows offerings were pissing me off 23:19:39 Is it specifically for being used as a remote terminal? 23:19:42 e4thcom is made by Manfred Mahlow, another German! 23:20:14 ryke, specifically as a Forth terminal, and handles about 4 different kinds of forths, including Mecrisp-Stellaris 23:20:57 rdrop-exit, all right, I am still tripping balls over here. 23:20:58 e4thcom waits for the MCU to send "OK." before uploading the next line of source 23:21:22 So essentially I allot some memory.. which at least labels something. 23:21:30 this makes e4thcom the fastest terminal outside of hardware handshaking 23:22:18 jsoft, yes, allot just allocates a memory window 23:23:28 jsoft, it's far simpler than you may think, all of Forth is, it took me years to realise it 23:23:43 lol 23:25:06 ok so how do I iterate over each byte in it then? 23:25:32 access each byte ? 23:25:47 Well yes, that 23:26:06 it's indexed to you read or write to the base with your index 23:26:18 it's indexed, so you read or write to the base with your index 23:26:25 thats how I do it anyway 23:26:53 initially I used the 'dump' word to look at the memory location that the allot gave me 23:27:17 which is also confusing as the bytes are backwards 23:27:49 ie '$EF' is displayed as "$FE" in "dump" 23:28:07 I should write a dump that turns them around :) 23:28:11 =8-O why? 23:28:37 you're dump be crazy :) 23:28:39 "dump" shows them as saved in actual memory 23:29:04 individual bytes don't have endianess 23:29:07 https://imgur.com/a/R9XP1j1 <- here is me wee test setup btw :) 23:29:24 $ fe should show up as fe in a dump 23:29:52 maybe you're speaking of the order of the bytes in a cell 23:30:42 jsoft, here is mine: file:///home/tp/projects/programming-languages/forth/mecrisp-stellaris/mecrisp-unofficial-doc/_build/html/modern-forth-development-environment.html?highlight=development#a-modern-forth-ide 23:32:11 That would be fantastic if I could access your machine locally :P 23:33:22 jsoft, thats the way, hantek DSO and a F0 Disco with Mecrisp-Stellaris ! 23:34:13 jsoft, every forther wants a different dev environment, we are as different from one another as possible 23:34:31 tp, I dunno, I mostly like this steallris business 23:34:34 no two forthers want the same thing in my experience 23:35:03 If I can get these leds all working proper, + RTC, then I am good to go making a PCB for the project 23:35:34 jsoft, yeah Mecrisp-Stellaris is excellent, but I modify t for 460800 baud, hardware handshaking and a simple stack display ".s" 23:35:56 does it not have SEE? 23:36:01 Yeah perhaps I might do that later, but for now, this is amazeballs enough. 23:36:23 it does but you have to load the 'dissasembler-m0' Word to get it 23:36:42 jsoft, yeah your setup is as good as it gets without Mecrisp-Stellaris core mods 23:37:43 jsoft, the F0 rtc is a bit complex but Andrew Palm uses it in the F051 directory code examples 23:38:07 so thats a great place to study the RTC 23:38:39 jsoft, do you by any chance use my svd2forth memory mapped words ? 23:39:38 the enable stuff like this: 23:39:41 RTC_CTL. 23:39:41 RTC_CTL (read-write) $00000020 23:39:41 3|3|2|2|2|2|2|2|2|2|2|2|1|1|1|1|1|1|1|1|1|1| 23:39:41 1|0|9|8|7|6|5|4|3|2|1|0|9|8|7|6|5|4|3|2|1|0|9|8|7|6|5|4|3|2|1|0 23:39:41 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 23:40:15 (but thats a RISC-V chip with Mecrisp-Quintus, same concept tho) 23:41:27 no 23:41:40 Well not that I am aware of :P 23:41:47 youd know 23:41:54 I just use the default image thingy 23:42:21 All right, I gotta start being productive 23:42:23 problem is you can only have a select number of memory mapped words as they take up a lot of flash space 23:42:45 no way you can have every single register for every of the 33 stm32f051 peripherals 23:42:59 you load them as a word 23:43:07 as you do now 23:43:19 after configuring what you want 23:43:48 my system creates them and produces a "memmap.fs" word 23:44:21 after it's loaded into flash, you can read in real time, any register in your selection 23:44:40 Yeah I don't need most registers though 23:44:49 so I will only bother if I need them 23:44:58 I have a special one for the f051 which has hand edited legends for the most common peripherals 23:45:05 really ? 23:45:16 For now, yes 23:45:19 well thats true as there are so many 23:45:49 but you need RCC, GPIOx, NVIC, EXTI, RTC (in your case), Flash 23:45:58 as a minimum Id guess 23:47:15 my IDE screenshot above shows RCC_AHBENR with legends and you can see that the GPIOS are enabled 23:49:00 Yeah I have all the clocks and the GPIO stuff sorted 23:49:12 Toggling the pin I will use to talk to the LED's 23:49:22 cool, thats half the trouble 23:49:43 another issue I had is in some select cases, bitfields are PROTECTED 23:50:02 For the RTC ? 23:50:05 and I spent days wondering why nothing I did could change them 23:50:20 um, no in this case it was for something else 23:50:27 Writing to flash ? 23:50:29 but the same thing applies 23:50:37 yeah, could have been 23:50:45 Or EEPROM or something ? 23:50:59 I know in PIC's it need some weird ass sequency 23:51:04 so I write a 'assert' word for every config and that located the failed changes 23:51:12 yeah, similar thing 23:51:20 after that it was easy 23:51:51 these are the little things that caught me out and why I focussed on easy register data printouts 23:52:03 just to give me the ;big picture' 23:52:45 the databooks are excellent but it only takes missing one simple line and nothing works 23:53:00 have you used interrupts yet ? 23:53:04 Yeah 23:53:31 so you know how to address interrupt numbers over 32 ? 23:53:44 i was stuck on that for ages 23:53:47 nope 23:54:02 ther eis only one line in the manual regarding it 23:54:19 and I read it but it didnt click 23:54:20 In this case I was just handling a button push, which was on line... I dunno, 0-2 or something 23:54:33 exactly, PA0 is the user PB 23:54:44 and it's line 6 ? 23:54:52 I cant remember atm 23:55:18 anyway there are two registers, one is 0 - 32, the other is 33 - 64 23:55:34 Hmm shit, I have selected PA0 23:55:36 on bigger mcus, there are ,ore 23:55:38 As the output pin 23:55:44 Which is the push button 23:55:46 we all did that 23:55:48 I should use something 23:55:51 ... else 23:56:02 yeah, guilty here also 23:56:06 Operation use something else is underway 23:56:13 PC8 and 9 are the leds 23:56:33 Yep i've toggled those good and proper :) 23:57:10 thats what they are for! worn out your reset button yet ? 23:57:28 I've pressed it about 20 timew 23:57:29 stimes 23:57:32 times, as well 23:57:41 whats the 'clear ram' word again ? 23:57:46 lol, Ive worn out one over a few years about 100 presses a day 23:58:02 I dont use the clearram 23:58:05 I use a reset 23:58:32 i found some odd states sometimes when I only clear ram 23:58:59 all due to my programs of course 23:59:45 here is a PB interrupt reading a LMT01 temperature sensor on a stm32f103 23:59:48 30,68 C 23:59:49 87,34 F 23:59:59 --- log: ended forth/19.11.21