From: <ho...@tj...> - 2024-02-06 10:38:28
|
A risc-v update. AmForth-RV update Good progress made with the CH32V307 [0] Words defined in the RAM dictionary can now be appended to the FLASH dictionary so user defined words (individual words or the entire RAM dictionary) are able to survive a reset. This was one of my major milestones and (in my mind) a requirement for a self-hosted Forth. I was not able to achieve this with the FE310 based red v board. Additionally, something new to AmForth. Compiled C objects can be linked into AmForth-RV and called from within CODEWORDs. This is a build level modification and arguments are passed to the C function using assembly according to the risc-v calling convention. The CH32V307 makes a very good target mcu for AmForth-RV and for experimenting with embedded RISC-V in general. - The development board is inexpensive and available [1] [2] - There is official documentation and many 3rd party resources - The mcu can program its own flash whilst executing from flash - AmForth-RV can be built with an open source toolchain (build in < 3s, flash in < 6s ) If you are interested in trying some risc-v hardware I think it is a good choice. AmForth-RV is still experimental, but has made a step in the direction of being less so. There are quite a few decisions to be made, so any thoughts on what AmForth-RV might look like in the future are very much welcomed. Best wishes, Tristan [0] https://github.com/openwch/ch32v307 [1] https://wchofficialstore.aliexpress.com/store/1100367542 [2] https://www.aliexpress.com/item/1005004329125620.html (and many other suppliers) A brief annotated/edited session showing saving a RAM dictionary word. // see if a word 3+ has been defined // ok > show 3+ LFA..... (LFA)... FFA..... (FFA)... NFA..... XT...... (XT).... word.... ok // no it has not, so define it in the RAM dictionary // > : 3+ 1+ 1+ 1+ ; ok // and see that it exists // > show 3+ LFA..... (LFA)... FFA..... (FFA)... NFA..... XT...... (XT).... word.... 20003A54 200039B4 20003A58 00000000 20003A5C 20003A60 COLON 3+ (in RAM) ok // now append the word 3+ to the FLASH dictionary // > save 3+ 3+ HHHHBBBB 3+ ok // and see that it exists // > show 3+ LFA..... (LFA)... FFA..... (FFA)... NFA..... XT...... (XT).... word.... 0000D200 0000D094 0000D204 00000000 0000D208 0000D20C COLON 3+ (in FLASH) 20003A54 200039B4 20003A58 00000000 20003A5C 20003A60 COLON 3+ (in ROM) ok // it does, twice, once in RAM and once in FLASH // // reset the board // AmForth-RV 7.0 RV32IMAFC WCH CH32V307 Fri 19 Jan 2024 16:46:34 GMT // see if 3+ exists // > words 3+ forth-wordlist environment riscv-wordlist @cycle type0 hifive-turnkey rev-info build-info mtimecmp mtime led.init -led +led > forth-wordlist >flash.p ram>flash flash>ram ram>rom rom>ram // see if it works // > 100 3+ ok > u. 103 ok > |
From: <ho...@tj...> - 2024-04-04 06:57:49
|
A risc-v update. Getting there [0] It can run ISRs written in both (almost pure) Forth and C [1]. There is has an evolving transpiler from Forth to ITC speak and the save and see words are now more robust. Some toolchain and building documentation has been added [2], and the beginnings of a cookbook. I'm still tidying up the latest archive, but in the meantime, if anyone has a WCH development board and wants to try it, drop me a message off list. Best wishes, Tristan [0] http://tjnw.co.uk/amforth-rv/pages/logs.html [1] https://tjnw.co.uk/amforth-rv/pages/interrupts.html (with video!) [2] http://tjnw.co.uk/amforth-rv/pages/building.html |
From: <ho...@tj...> - 2024-04-13 16:23:47
|
A RISC-V update. AmForth-RV is now self-supporting (no C libraries required) for the WCH CH32V307. Source and a pre-built hex file are here [0] Best wishes, Tristan [0] https://tjnw.co.uk/amforth-rv |
From: Martin N. <amf...@mg...> - 2024-04-13 17:47:14
|
Thanks for your work. I've just ordered a development board. M. On Sat, 13 Apr 2024 17:08:53 +0100 ho...@tj... wrote: > A RISC-V update. > > AmForth-RV is now self-supporting (no C libraries required) for the > WCH CH32V307. Source and a pre-built hex file are here [0] > > Best wishes, > Tristan > > [0] https://tjnw.co.uk/amforth-rv > > > > _______________________________________________ > Amforth-devel mailing list for http://amforth.sf.net/ > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel > > -- Regards, Martin Nicholas. E-mail: mg...@mg.... |
From: <ho...@tj...> - 2024-04-16 21:01:57
|
Thoughts/fixes very much welcomed. Currently struggling with USB. Best wishes, Tristan On 2024-04-13 18:25, Martin Nicholas via Amforth-devel wrote: > Thanks for your work. I've just ordered a development board. > > M. > > On Sat, 13 Apr 2024 17:08:53 +0100 > ho...@tj... wrote: > >> A RISC-V update. >> >> AmForth-RV is now self-supporting (no C libraries required) for the >> WCH CH32V307. Source and a pre-built hex file are here [0] >> >> Best wishes, >> Tristan >> >> [0] https://tjnw.co.uk/amforth-rv >> >> >> >> _______________________________________________ >> Amforth-devel mailing list for http://amforth.sf.net/ >> Amf...@li... >> https://lists.sourceforge.net/lists/listinfo/amforth-devel >> >> |
From: Martin N. <amf...@mg...> - 2024-04-17 08:14:15
|
On Tue, 16 Apr 2024 19:34:13 +0100 ho...@tj... wrote: > Thoughts/fixes very much welcomed. Currently struggling with USB. There is a library for flashforth, see below. It's for an Atmega 32u4, However I quickly came to the conclusion that it had some flaws and shelved attempts to get it working. https://sourceforge.net/p/flashforth/code/ci/master/tree/avr/forth/usbcdc.fs -- Regards, Martin Nicholas. E-mail: rep...@mg... (Address will be valid throughout 2024). |
From: Mark R. <cab...@gm...> - 2024-04-16 21:12:12
|
This is really great to see Tristan. Bravo to your efforts getting this going! On Sat, Apr 13, 2024 at 7:24 PM <ho...@tj...> wrote: > A RISC-V update. > > AmForth-RV is now self-supporting (no C libraries required) for the > WCH CH32V307. Source and a pre-built hex file are here [0] > > Best wishes, > Tristan > > [0] https://tjnw.co.uk/amforth-rv > > > > _______________________________________________ > Amforth-devel mailing list for http://amforth.sf.net/ > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel > |
From: <ho...@tj...> - 2024-10-20 08:22:49
|
A risc-v update for CH32V307 AmForth-RV can now compile to flash directly rather than saving a word already compiled in ram as before. This is better and much more like the approach taken by the AVR code base. However, it does need an mcu that is able to do this. The flag field in the dictionary is used more, which simplifies and optionally declutters word listings. I think this was something that was intended, but not fully implemented. Being able to call C library functions from Forth has helped with beginning to add IEEE-754 floating point to AmForth-RV. There is a link to a pre-built hex file on [1] and the development board seems to be available in the EU from [2]. More details in the project logs [3]. Best wishes, Tristan [1] https://tjnw.co.uk/amforth-rv/pages/building.html [2] https://www.elektor.com/products/wch-ch32v307v-evt-r1-risc-v-development-board [3] https://tjnw.co.uk/amforth-rv/pages/logs.html |
From: Keith A. <ca...@pi...> - 2024-02-06 17:45:02
|
Thanks for the update! Both the board and the experimental AmForth-RV implementation look really interesting. I'm curious how you're planning to use the compiled C object support. I can see that being helpful to access existing high-level building blocks for things like USB. Is it possible to give a walk-through of how it works? Cheers! Keith On 2/6/24 02:23, ho...@tj... wrote: > A risc-v update. > > AmForth-RV update > > Good progress made with the CH32V307 [0] > > Words defined in the RAM dictionary can now be appended to the FLASH > dictionary so user defined words (individual words or the entire RAM > dictionary) are able to survive a reset. This was one of my major > milestones and (in my mind) a requirement for a self-hosted Forth. I > was not able to achieve this with the FE310 based red v board. > > Additionally, something new to AmForth. Compiled C objects can be linked > into AmForth-RV and called from within CODEWORDs. This is a build > level modification and arguments are passed to the C function using > assembly according to the risc-v calling convention. > > The CH32V307 makes a very good target mcu for AmForth-RV and for > experimenting with embedded RISC-V in general. > > - The development board is inexpensive and available [1] [2] > - There is official documentation and many 3rd party resources > - The mcu can program its own flash whilst executing from flash > - AmForth-RV can be built with an open source toolchain (build in < > 3s, flash in < 6s ) > > If you are interested in trying some risc-v hardware I think it is a > good choice. > > AmForth-RV is still experimental, but has made a step in the direction > of being less so. There are quite a few decisions to be made, so any > thoughts on what AmForth-RV might look like in the future are very > much welcomed. > > Best wishes, > Tristan > > [0] https://github.com/openwch/ch32v307 > [1] https://wchofficialstore.aliexpress.com/store/1100367542 > [2] https://www.aliexpress.com/item/1005004329125620.html > (and many other suppliers) > > A brief annotated/edited session showing saving a RAM dictionary word. > > // see if a word 3+ has been defined // > > ok >> show 3+ > LFA..... (LFA)... FFA..... (FFA)... NFA..... XT...... (XT).... word.... > ok > > // no it has not, so define it in the RAM dictionary // > >> : 3+ 1+ 1+ 1+ ; > ok > > // and see that it exists // > >> show 3+ > LFA..... (LFA)... FFA..... (FFA)... NFA..... XT...... (XT).... word.... > 20003A54 200039B4 20003A58 00000000 20003A5C 20003A60 COLON 3+ (in > RAM) > ok > > // now append the word 3+ to the FLASH dictionary // > >> save 3+ > 3+ HHHHBBBB 3+ > ok > > // and see that it exists // > >> show 3+ > LFA..... (LFA)... FFA..... (FFA)... NFA..... XT...... (XT).... word.... > 0000D200 0000D094 0000D204 00000000 0000D208 0000D20C COLON 3+ (in > FLASH) > 20003A54 200039B4 20003A58 00000000 20003A5C 20003A60 COLON 3+ (in > ROM) > ok > > // it does, twice, once in RAM and once in FLASH // > > // reset the board // > > AmForth-RV 7.0 RV32IMAFC WCH CH32V307 > Fri 19 Jan 2024 16:46:34 GMT > > // see if 3+ exists // > >> words > 3+ forth-wordlist environment riscv-wordlist @cycle type0 > hifive-turnkey rev-info build-info mtimecmp mtime led.init -led +led >> forth-wordlist >flash.p ram>flash flash>ram ram>rom rom>ram > > // see if it works // > >> 100 3+ > ok >> u. > 103 ok >> > > > _______________________________________________ > Amforth-devel mailing list for http://amforth.sf.net/ > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel > |
From: Erich W. <ew....@na...> - 2024-02-06 18:08:29
|
Hello Tristan, I'm quite impressed by the progress you make. And I think it's high time to at least answer: "I read your mails" :) That being said, I don't know, how much of my health stuff I mentioned to you. So I'll let you know this much: 1. Last July my right eye suffered an ablatio retinae. This in itself is bad already, but not entirely unexpected, since I am myopic since the age of 10. So it got fixed by surgery, I'll spare you all the interesting details. The repair didn't last and it came off again TWO more times! And just because, in November my left eye suffered the same problem. So from November 10.th to the end of the year I was not seeing much and somewhat depressed over all. In January the final step for the right eye was done and I start to see a lot better now. But even reading on the screen was close to impossible for two months. Sigh. I have not been to work since July, and with some luck I can start going there again (reduced time initially) in March. 2. About 6 years ago I acquired a thing called "chronic fatigue syndrom". This term is for lack of better understanding, what's going on. The symptoms are similar or maybe the same as in Long Covid, but the phenomenon has existed before. I readily admit, that I have only a very mild version of this. But I can feel the lack of power (physically and mentally) every day. The whole thing is not understood, let alone any root causes. Anyway. This has forced me to let go of several things, including the amforth projekt. With that now out of the way, I would suggest, that you receive the login credentials for the source forge repository. Unless of course, you have different plans. It's up to you. If you are interested, do you have some sort of pgp key or so, where I can send the magic spells hidden from prying eyes? Along other lines: I have started to play with my avr/atmega boards again, and I am currently working to get a much newer radio chip connected and working: the hopeRF rfm69. In comparison to the old rfm12 this is a wizzard module. It can handle packet radio on it's own, while the rfm12 could only handle one byte transmit/receive, one byte in the fifo. Plus the rfm69 will handle aes encryption, automatic checksumming and other useful tricks on its own. However, that means that I need to read a lot of documentation and other projects' code to understand, how to tame the beast. I can currently send something, but I have not tried to receive the datagram yet. I can "see" the transmission in gnuradio with an DVB-T stick used as receiver. The whole thing is fun, but I am very slow. Let me know, what you think. Cheers, Erich I'll attach my public key: pub rsa4096 2020-12-12 [SC] 03D05884448B9F17B9EC536ADBA0681A2AFE4FE1 uid [ultimate] Erich Wälde (AmForth project) <ew....@na...> -------------- next part -------------- ho...@tj... writes: > A risc-v update. > > AmForth-RV update > > Good progress made with the CH32V307 [0] > > Words defined in the RAM dictionary can now be appended to the FLASH > dictionary so user defined words (individual words or the entire RAM > dictionary) are able to survive a reset. This was one of my major > milestones and (in my mind) a requirement for a self-hosted Forth. I > was not able to achieve this with the FE310 based red v board. > > Additionally, something new to AmForth. Compiled C objects can be linked > into AmForth-RV and called from within CODEWORDs. This is a build > level modification and arguments are passed to the C function using > assembly according to the risc-v calling convention. > > The CH32V307 makes a very good target mcu for AmForth-RV and for > experimenting with embedded RISC-V in general. > > - The development board is inexpensive and available [1] [2] > - There is official documentation and many 3rd party resources > - The mcu can program its own flash whilst executing from flash > - AmForth-RV can be built with an open source toolchain (build in < 3s, flash in > < 6s ) > > If you are interested in trying some risc-v hardware I think it is a > good choice. > > AmForth-RV is still experimental, but has made a step in the direction > of being less so. There are quite a few decisions to be made, so any > thoughts on what AmForth-RV might look like in the future are very much > welcomed. > > Best wishes, > Tristan > > [0] https://github.com/openwch/ch32v307 > [1] https://wchofficialstore.aliexpress.com/store/1100367542 > [2] https://www.aliexpress.com/item/1005004329125620.html > (and many other suppliers) > > A brief annotated/edited session showing saving a RAM dictionary word. > > // see if a word 3+ has been defined // > > ok >> show 3+ > LFA..... (LFA)... FFA..... (FFA)... NFA..... XT...... (XT).... word.... > ok > > // no it has not, so define it in the RAM dictionary // > >> : 3+ 1+ 1+ 1+ ; > ok > > // and see that it exists // > >> show 3+ > LFA..... (LFA)... FFA..... (FFA)... NFA..... XT...... (XT).... word.... > 20003A54 200039B4 20003A58 00000000 20003A5C 20003A60 COLON 3+ (in RAM) > ok > > // now append the word 3+ to the FLASH dictionary // > >> save 3+ > 3+ HHHHBBBB 3+ > ok > > // and see that it exists // > >> show 3+ > LFA..... (LFA)... FFA..... (FFA)... NFA..... XT...... (XT).... word.... > 0000D200 0000D094 0000D204 00000000 0000D208 0000D20C COLON 3+ (in FLASH) > 20003A54 200039B4 20003A58 00000000 20003A5C 20003A60 COLON 3+ (in ROM) > ok > > // it does, twice, once in RAM and once in FLASH // > > // reset the board // > > AmForth-RV 7.0 RV32IMAFC WCH CH32V307 > Fri 19 Jan 2024 16:46:34 GMT > > // see if 3+ exists // > >> words > 3+ forth-wordlist environment riscv-wordlist @cycle type0 > hifive-turnkey rev-info build-info mtimecmp mtime led.init -led +led >> forth-wordlist >flash.p ram>flash flash>ram ram>rom rom>ram > > // see if it works // > >> 100 3+ > ok >> u. > 103 ok >> > > > _______________________________________________ > Amforth-devel mailing list for http://amforth.sf.net/ > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel -- May the Forth be with you ... |
From: Erich W. <ew....@na...> - 2024-02-06 18:10:51
|
so, it's not offlist at all, sigh. Oh, well. E. Erich Wälde <ew....@na...> writes: > [[PGP Signed Part:Undecided]] > Hello Tristan, > -- May the Forth be with you ... |