TG9541 / stm8ef

STM8 eForth - a user friendly Forth for simple µCs with docs
https://github.com/TG9541/stm8ef/wiki
Other
311 stars 66 forks source link

CREATE fails in STM8S #441

Closed Peffrey closed 2 years ago

Peffrey commented 2 years ago

Hi,

I am really enjoying using this toolchain for my project. However, I'm a bit stuck at the moment:

I'm trying to CREATE a byte-oriented data table for an audio DSP in a STM8S105 running STM8EF2.2.29.pre1 and using e4thcom-0.84, it ends up choking at a certain point and the loading/compilation ends. I have tried loading in both buffered and non-buffered modes in e4thcom, same effect. I didn't see any similar reports as I searched past issues.

Here's what I'm seeing in the terminal: create dsp_table ok $1 c, $00 c, $6C c, ok $1 c, $01 c, $04 c, ok

[ ... lots more table data ]

$00 c, $00 c, $00 c, $00 c, $00 c, $00 c, ok $00 c, $00 c, $00 c, $00 c, $00 c, $0? at Line 354 in File ./target/dsp_basic.fth

I've tried loading this after a reset, and also #include in my Forth code, it fails at random lines, usually +/- a few from what is reported above. I've also tried breaking the table up into smaller chunks, still the same result. Is the STM8S running out of RAM? After a cold and reset I can get the STM8S responsive again.

My main code is a much larger file and always loads fine, so I'm wondering why I only get this trying to CREATE the data table? Before flagging this as a "bug" I'm open to being corrected on use of the toolchain or directives/memory control words I may not understand correctly. I can also successfully include this in gforth, so the data table seems OK.

Thanks and let me know what more info you need from me, if any.

Cheers,

Peff

VK6TT commented 2 years ago

Hi Peff Are you writing the table into ram or the non volatile flash? And how many bytes in your table?

Regards Richard

⁣Get BlueMail for Android ​

On Oct 21, 2021, 8:34 AM, at 8:34 AM, Peffrey @.***> wrote:

Hi,

I am really enjoying using this toolchain for my project. However, I'm a bit stuck at the moment:

I'm trying to CREATE a byte-oriented data table for an audio DSP in a STM8S105 running STM8EF2.2.29.pre1 and using e4thcom-0.84, it ends up choking at a certain point and the loading/compilation ends. I have tried loading in both buffered and non-buffered modes in e4thcom, same effect. I didn't see any similar reports as I searched past issues.

Here's what I'm seeing in the terminal: create dsp_table ok $1 c, $00 c, $6C c, ok $1 c, $01 c, $04 c, ok

[ ... lots more table data ]

$00 c, $00 c, $00 c, $00 c, $00 c, $00 c, ok $00 c, $00 c, $00 c, $00 c, $00 c, $0? at Line 354 in File ./target/dsp_basic.fth

I've tried loading this after a reset, and also #include in my Forth code, it fails at random lines, usually +/- a few from what is reported above. I've also tried breaking the table up into smaller chunks, still the same result. Is the STM8S running out of RAM? After a cold and reset I can get the STM8S responsive again.

My main code is a much larger file and always loads fine, so I'm wondering why I only get this trying to CREATE the data table? Before flagging this as a "bug" I'm open to being corrected on use of the toolchain or directives/memory control words I may not understand correctly. I can also successfully include this in gforth, so the data table seems OK.

Thanks and let me know what more info you need from me, if any.

Cheers,

Peff

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/TG9541/stm8ef/issues/441

Peffrey commented 2 years ago

Hi Richard,

Thanks for your quick reply. After experimenting today, I realized this is MY error--I set my #include for the file with the table to CREATE before NVM so the table was going into RAM and of course choking. My bad and you can close the issue, it's not really a problem. I deserve the embarrassment :P

Cheers,

Peff

On Thu, Oct 21, 2021 at 11:35 PM Richard @.***> wrote:

Hi Peff Are you writing the table into ram or the non volatile flash? And how many bytes in your table?

Regards Richard

⁣Get BlueMail for Android ​

On Oct 21, 2021, 8:34 AM, at 8:34 AM, Peffrey @.***> wrote:

Hi,

I am really enjoying using this toolchain for my project. However, I'm a bit stuck at the moment:

I'm trying to CREATE a byte-oriented data table for an audio DSP in a STM8S105 running STM8EF2.2.29.pre1 and using e4thcom-0.84, it ends up choking at a certain point and the loading/compilation ends. I have tried loading in both buffered and non-buffered modes in e4thcom, same effect. I didn't see any similar reports as I searched past issues.

Here's what I'm seeing in the terminal: create dsp_table ok $1 c, $00 c, $6C c, ok $1 c, $01 c, $04 c, ok

[ ... lots more table data ]

$00 c, $00 c, $00 c, $00 c, $00 c, $00 c, ok $00 c, $00 c, $00 c, $00 c, $00 c, $0? at Line 354 in File ./target/dsp_basic.fth

I've tried loading this after a reset, and also #include in my Forth code, it fails at random lines, usually +/- a few from what is reported above. I've also tried breaking the table up into smaller chunks, still the same result. Is the STM8S running out of RAM? After a cold and reset I can get the STM8S responsive again.

My main code is a much larger file and always loads fine, so I'm wondering why I only get this trying to CREATE the data table? Before flagging this as a "bug" I'm open to being corrected on use of the toolchain or directives/memory control words I may not understand correctly. I can also successfully include this in gforth, so the data table seems OK.

Thanks and let me know what more info you need from me, if any.

Cheers,

Peff

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/TG9541/stm8ef/issues/441

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/TG9541/stm8ef/issues/441#issuecomment-948681903, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWEX7T4BV7NE6WCUCGCQNZ3UIAQMXANCNFSM5GM34DXQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

TG9541 commented 2 years ago

@VK6TT thanks for spotting this!

@Peffrey porting code from gForth to STM8 eForth can be challenging - if you have questions feel free to file an issue!

I'm curious about your project and the DSP functions you're designing. If you'd find the time to write a Gist or put it in a GitHub repo it might be a good candidate for the example code page in the Wiki!