-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not run on Blue Pill STM32F103 #12
Comments
The latest version of uLisp for the Blue Pill and Maple Mini is 3.0b. Are you using Roger Clark's core? |
Yes, indeed, I was trying 3.0b but using the STM32 official core, not Roger Clark's. To clarify: I meant which version of the STM32 official Arduino core was last known 'working' :-) |
The official core doesn't have the FLASH EEPROM emulation. |
Oh, that would make sense then. I was going off the website examples that
mention both official and RogerClark cores working.
Thanks for the clarification!
…On Wed, Dec 2, 2020, 11:04 David Johnson-Davies ***@***.***> wrote:
The official core doesn't have the FLASH EEPROM emulation.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#12 (comment)>,
or unsubscribe
<https:/notifications/unsubscribe-auth/ACQWDX5HAGI4DKDMQLAHURLSSYGLRANCNFSM4UJ4CMZA>
.
|
Oh, that would make sense then. I was going off the website examples that mention both official and RogerClark cores working. Thanks for the clarification! |
You're right! I must have written that before I made (save-image) work with emulated EEPROM. I think if you say you want to use an SD Card for saving images, by uncommenting:
then it may work on the official core. Let me know and I'll update the documentation. |
No progress sadly with enabling sdcardsupport. I will switch to Roger's core for now but comments on the forums for stm32duino seem to mean that it's a legacy product already.
I think one might be able to flash the memory using the more direct HAL library calls for the stm32f103 official core but you have to deal with it in pages, not EEPROM style ARMmbed/mbed-os#6380 (an example of calls to HAL_FLASHEx_Erase / cache invalidation) |
I tried implementing the HAL library calls, but it turned out to be a lot of work. Another workaround would be to stick with the official core, but comment out the body of saveimage() and loadimage() so the errors go away. Regards, |
Hmm, I tried commenting out the respective bodies of saveimage() and loadimage() but that just gave me a lot of further errors with various flash write int/16 functions with -fpermissive and ISO C++ forbidding the use of no type name. I commented out the bodies of those functions too and now I am left with
as the only remaining errors. Thanks for your patience! |
Turns out casting pm to (uint32_t) instead makes it compile! Time to test it out. |
I just ran https:/stm32duino/STM32Examples/blob/master/examples/NonReg/BufferedEEPROM/BufferedEEPROM.ino |
Should be similar to the ARM32 version I see actually, maybe it'd be worth adding a #define officialstm32 and some #if defined checks in FlashWriteInt to it looks more like void FlashWriteInt (uint32_t *addr, int data) {
#if defined(officialstm32)
FlashWriteByte(addr, data & 0xFF); FlashWriteByte(addr, data>>8 & 0xFF);
FlashWriteByte(addr, data>>16 & 0xFF); FlashWriteByte(addr, data>>24 & 0xFF);
#else
FlashWrite16(addr, data & 0xFFFF); FlashWrite16(addr, data>>16 & 0xFFFF);
#endif
} where FlashWriteByte basically invokes void eeprom_buffered_write_byte(uint32_t pos, uint8_t value); and saveimage would need a buffer flush at the end (likewise for loadimage, a buffer fill) #if defined(officialstm32)
eeprom_buffer_flush(); //buffered API
#endif
return imagesize; I'll try it out tomorrow unless you beat me to it :) |
I probably won't get round to it, but it will be great if you can get it working. I'll then be able to make the official core the only core we need to support. |
@technoblogy Would it be OK to just be able to read/write 32-bits at a time from flash and be able to control the offset/amount of pages? Using STM32 HAL it seems possible to write full words at a time instead of writing individual bytes or halfwords. |
save-image writes a serial stream of bytes to the EEPROM or SD card, so I'm not sure what the advantage would be. |
Aha, I got the impression that save-image primarily wrote Arduino 32-bit integers and as the HAL seems to expose writing those directly I had an idea it might be more pleasant instead of having to do binary shifts with halfwords or bytes |
You could try it... |
I tied this but unfortunately it failed still:
Still have issues with complier:
` Any help would be appreciated. |
On the STM32F103 uLisp needs at least 128KBytes of flash memory to run. From the error messages it looks like your STM32F103C8T6 only has 64KBytes; as far as I know there are versions of the chip with both sizes. Do you have a datasheet for the board you are using that you can check? |
Thanks and I have to try another chip then. Got 4 of those sadly ... |
Trying to run the latest version on the official STM32 Core v 1.9.0 Arduino board gives me a bunch of errors in the IDE.
What's the last known working version?
The text was updated successfully, but these errors were encountered: