I've been testing the transient.fs file you have in your ff code on SourceForge. I've had some problems with it on my SCAMP3E. Creating transient and permanent words, sometimes when I discard the transients, they still appear in the dictionary. Other times, my board has crashed, and once it got completely out of control and I had to use EMPTY to get it working again. Is it possible there's a code error using it in Scamp3, or is there something I should consider before using the code?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hard to say. At least the area reserved by TRANSIENT must be large enough to fit all the transient words.
I have not used it myself except doing some simple tests.
Those words manipulate LATEST which is a eeprom emulated variable, and it is cached in ram.
There is a delayed update of ram to emulated eeprom in flash. Maybe there are some problems in that area, depending on execution timing of those words.
The transient words were first developed on Atmega. It has real eeprom and it updates the eeprom for each executed line when state is interpreting.
PIC24 waits for 300 milliseconds after the last received character before updating the emulated flash. But I think it should not matter.
Can you give some examples of when it fails.
Last edit: Mikael Nordman 2025-09-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
: test2 ." this is a permanent word" ;
Then words----> i saw test1 ,blank blank test2 test3
test1 ---> ok
test2 ---> ok
test3 ---> ok
discard
words---> i saw again all words. i ran tes1 --->ok test2---> system crash
reset and try again all---> all workig well only the words---> test1, lank blank test3, not contiguos.
reset and try again all---> now all seem ok but after run test 3, the system crash again .
reset but system working bad. a lot of bad behaviors---> only work nice after EMPTY.
because i loose all my defined words i didn't try again.
Last edit: Pere font vilanova 2025-09-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There seems to be a serious bug in FlashForth for PIC24. Any code compiled at an absolute flash address greater than $8000 ($8000 + PFL virtual address) in the) can be corrupt.
I guess this has not surfaced earlier because no-one has made so large programs.
The transient code is compiled to the end of flash, so the problem appears.
The problem is in the calculation of the negative RCALL offset address when the offset is greater than $8000.
The PIC18 and Atmega does not have the problem because it uses absolute CALL instructions at large offsets.
So TRANSIENT is unusable because it compiles to an address larger than $8000 in the end of flash.
Last edit: Mikael Nordman 2025-09-02
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The fix has been published. Henceforth RCALL, can only be used with 16-bit unsigned offsets that are always used as a backwards relative reference. This is also the case for normal FF code.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I though about a solution to make older versions of FF to work with the transient feature.
Here the transient words are located below the $8000 flash real address.
I've been testing the transient.fs file you have in your ff code on SourceForge. I've had some problems with it on my SCAMP3E. Creating transient and permanent words, sometimes when I discard the transients, they still appear in the dictionary. Other times, my board has crashed, and once it got completely out of control and I had to use EMPTY to get it working again. Is it possible there's a code error using it in Scamp3, or is there something I should consider before using the code?
Hard to say. At least the area reserved by TRANSIENT must be large enough to fit all the transient words.
I have not used it myself except doing some simple tests.
Those words manipulate LATEST which is a eeprom emulated variable, and it is cached in ram.
There is a delayed update of ram to emulated eeprom in flash. Maybe there are some problems in that area, depending on execution timing of those words.
The transient words were first developed on Atmega. It has real eeprom and it updates the eeprom for each executed line when state is interpreting.
PIC24 waits for 300 milliseconds after the last received character before updating the emulated flash. But I think it should not matter.
Can you give some examples of when it fails.
Last edit: Mikael Nordman 2025-09-01
Then words----> i saw test1 ,blank blank test2 test3
reset and try again all---> all workig well only the words---> test1, lank blank test3, not contiguos.
Last edit: Pere font vilanova 2025-09-01
There seems to be a serious bug in FlashForth for PIC24. Any code compiled at an absolute flash address greater than $8000 ($8000 + PFL virtual address) in the) can be corrupt.
I guess this has not surfaced earlier because no-one has made so large programs.
The transient code is compiled to the end of flash, so the problem appears.
The problem is in the calculation of the negative RCALL offset address when the offset is greater than $8000.
The PIC18 and Atmega does not have the problem because it uses absolute CALL instructions at large offsets.
So TRANSIENT is unusable because it compiles to an address larger than $8000 in the end of flash.
Last edit: Mikael Nordman 2025-09-02
Can this issue be fixed and if so will it be fixed in a next release of FF for PIC24?
Last edit: Fred Zelders 2025-09-02
thanks for the information.
I have a fix for the RCALL problem and will release it soon.
The fix has been published. Henceforth RCALL, can only be used with 16-bit unsigned offsets that are always used as a backwards relative reference. This is also the case for normal FF code.
I though about a solution to make older versions of FF to work with the transient feature.
Here the transient words are located below the $8000 flash real address.
Last edit: Mikael Nordman 2025-09-11
ohh I will try soon. its a kind of forget for testing words....