Replies: 11 comments
-
On Sun, Jun 30, 2024, 02:42 mcctuxic ***@***.***> wrote:
Hi,
I am confused... :)
To make live a little easier when starting with zeptoforth I bought a
Cyton Maker Pi Pico board, which includes beside some other convenient
things a SDcard slot attached to GPIO pins of the Pi Pico (Pi Pico W in my
case).
You recommended me to use zeptoed, which edits files on a SDcard. Perfect
match!
But at the moment I cannot decide, whether the manufacturer has wired the
SDcard slot the wrong way, or I am not understanding the whole thing.
The schematics of the board can be found here:
https://www.cytron.io/p-maker-pi-pico-base at the bottom of the page at
"Resources".
According to the schematics the "CS" pin of SPI1 is connected to GPIO 15.
According to the Pi Pico W GPIO 15 is NOT related to SPI1/CS but to
SPI1/TX.
BUT :) When I insert a SD card into the slot, the GPIO-led of the board
lights up.
Is it possible, that Cyto has hardwired CS to the
card-is-inserted-into-slot switch and this is feed
back to GPIO 15 as an indicator for a card being inserted. "CS the other
way around" so to say.
And: How can I tell zeptoforth about this setup.
I am asking first before trying anything, because I don't want to fry a
GPIO pin with the wrong setup...
Cheers!
Tuxic
I don't think anything is wrong here. Chip Select (GPIO 15) is *high* when
not asserted, and the act of inserting an SD card should enable current to
flow through it, hence the lit-up LED. When you are actually accessing the
SD card it should go dark due to asserting CS making it go low.
Travis
… |
Beta Was this translation helpful? Give feedback.
-
Hi Travis, may be I am a step further ... kind of. With a continuity tester I checked, that GPIO 15 of the Pi Pico is connected to Pin 2 of the micro SD card adapter on the board. From you "Getting started" document I read (and finally recognized and understand), that the CS pin can be any pin. With this information I dared to experiment a little further. On GENTOO Linux I partioned a 2 GB micro SD card with on partion only and the full available space with fdisk. I used this code:
Executing this code results in: At this point my PIN-fu had come to an end. Cheers! |
Beta Was this translation helpful? Give feedback.
-
I checked PIN15 while executing the code (see above): It flickers! |
Beta Was this translation helpful? Give feedback.
-
Sorry.... The code I executed contains this line and is located in a block. |
Beta Was this translation helpful? Give feedback.
-
On Sun, Jun 30, 2024 at 12:19 PM mcctuxic ***@***.***> wrote:
Hi Travis,
may be I am a step further ... kind of.
With a continuity tester I checked, that GPIO 15 of the Pi Pico is
connected to Pin 2 of the micro SD card adapter on the board.
According to wikipedia Pin 2 of the micro SD card is CS indeed. So...at
least the schematics are correct in that respect.
From you "Getting started" document I read (and finally recognized and
understand), that the CS pin can be any pin.
The CS pin as used by zeptoforth is any GPIO hooked up to the CS pin of the
attached device. It can even be the SPI peripheral's CS pin, because it
will use it as a normal GPIO rather than with the SPI alternate function.
What I do not understand is, that the GPIO LED of GPIO 15 lights up, when
I insert a SD card. CS logic is negativ as far
as I know.
Is this right after you have rebooted, before you have initialized the SDHC
card interface and the FAT32 filesystem?
So right after a reboot pin 15 must be an input pin when there is no
software interference.
All pins start out as input pin, which I have confirmed from looking at the
RP2040 datasheet.
With this information I dared to experiment a little further.
On GENTOO Linux I partioned a 2 GB micro SD card with on partion only and
the full available space with fdisk.
With mkfs.fat -F 32 I created a 32 bit FAT filesystem on /dev/sdb1 (on my
system).
One little note - zeptoforth currently only supports SDHC and SDXC cards,
and an old 2 GB microSD card may be a traditional SD card which it does not
support. Why don't you try using a larger SD card, which will be certain to
be an SDHC or SDXC card?
I used this code:
oo import
simple-fat32 import
fat32-tools import
pin import
15 output-pin
10 11 12 15 1 <simple-fat32-fs> my-fs init-object
and forced CS/pin 15 to be an output beforehand.
Executing this code results in:
block out of range
The same happens, when pin 15 is not forced to anything.
At this point my PIN-fu comes to an end.
What can I try further to make this working - I am looking forward to
ZEPTOED ! :)
Cheers!
Tuxic
Note that OUTPUT-PIN is unnecessary here ─ initializing a <SIMPLE-FAT32-FS>
object, which initializes an SDHC card interface, will do this for you.
The result you get here, though, really looks like you might be using an
older SD (not SDHC) card, which is unsupported.
Travis
… Message ID: <tabemann/zeptoforth/repo-discussions/108/comments/9918094@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
On Sun, Jun 30, 2024 at 12:26 PM mcctuxic ***@***.***> wrote:
I checked PIN15 while executing the code (see above): It flickers!
Still the error remains.
The issue is probably that you are using an old-style SD card (which is not
supported) rather than an SDHC card. Try using a card larger than 2 GB, so
you can be sure you are not using an old-style SD card.
Travis
… Message ID: <tabemann/zeptoforth/repo-discussions/108/comments/9918117@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
On Sun, Jun 30, 2024 at 1:23 PM Travis Bemann ***@***.***> wrote:
On Sun, Jun 30, 2024 at 12:26 PM mcctuxic ***@***.***>
wrote:
> I checked PIN15 while executing the code (see above): It flickers!
> Still the error remains.
>
The issue is probably that you are using an old-style SD card (which is
not supported) rather than an SDHC card. Try using a card larger than 2 GB,
so you can be sure you are not using an old-style SD card.
The thing that is curious, though, is that I put checks to prevent using
old-style SD cards in the code, so it is interesting that they are not
working.
Travis
… Message ID: <tabemann/zeptoforth/repo-discussions/108/comments/9918117@
> github.com>
>
|
Beta Was this translation helpful? Give feedback.
-
On Sun, Jun 30, 2024 at 2:21 PM Travis Bemann ***@***.***> wrote:
On Sun, Jun 30, 2024 at 1:23 PM Travis Bemann ***@***.***> wrote:
> On Sun, Jun 30, 2024 at 12:26 PM mcctuxic ***@***.***>
> wrote:
>
>> I checked PIN15 while executing the code (see above): It flickers!
>> Still the error remains.
>>
> The issue is probably that you are using an old-style SD card (which is
> not supported) rather than an SDHC card. Try using a card larger than 2 GB,
> so you can be sure you are not using an old-style SD card.
>
The thing that is curious, though, is that I put checks to prevent using
old-style SD cards in the code, so it is interesting that they are not
working.
Okay, just checked. Apparently SDHC cards start at 4 GB, so a 2 GB card
would be SD and not SDHC.
… Message ID: <tabemann/zeptoforth/repo-discussions/108/comments/9918117@
>> github.com>
>>
>
|
Beta Was this translation helpful? Give feedback.
-
I *had* to check this out right before going to work (its 4:34 am in the
morning/night).
I inserted a 16GB card, which was formatted like the previous one...
and...It works out-of-the-box! Great!
This is the first development environment which runs directly on
the chip and offers such a comfort like zeptoed, which I used right
after the SDHC/SDHX card was proper recognized!
Is there an explanation of error messages somewhere which maps
error messages to possible reason for their appearance?
A big THANK YOU for your help and patience, Travis!
Cheers!
Tuxic
…On 06/30 12:30, tabemann wrote:
On Sun, Jun 30, 2024 at 2:21 PM Travis Bemann ***@***.***> wrote:
> On Sun, Jun 30, 2024 at 1:23 PM Travis Bemann ***@***.***> wrote:
>
>> On Sun, Jun 30, 2024 at 12:26 PM mcctuxic ***@***.***>
>> wrote:
>>
>>> I checked PIN15 while executing the code (see above): It flickers!
>>> Still the error remains.
>>>
>> The issue is probably that you are using an old-style SD card (which is
>> not supported) rather than an SDHC card. Try using a card larger than 2 GB,
>> so you can be sure you are not using an old-style SD card.
>>
>
> The thing that is curious, though, is that I put checks to prevent using
> old-style SD cards in the code, so it is interesting that they are not
> working.
>
Okay, just checked. Apparently SDHC cards start at 4 GB, so a 2 GB card
would be SD and not SDHC.
> Message ID: <tabemann/zeptoforth/repo-discussions/108/comments/9918117@
>>> github.com>
>>>
>>
--
Reply to this email directly or view it on GitHub:
#108 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
On Sun, Jun 30, 2024 at 9:39 PM mcctuxic ***@***.***> wrote:
I *had* to check this out right before going to work (its 4:34 am in the
morning/night).
I inserted a 16GB card, which was formatted like the previous one...
and...It works out-of-the-box! Great!
Cool!
I ordered a 2 GB SD card today, and plan on figuring out how to support it
so that people using 2 GB SD cards can use them with zeptoforth.
This is the first development environment which runs directly on
the chip and offers such a comfort like zeptoed, which I used right
after the SDHC/SDHX card was proper recognized!
Nice that it worked for you! zeptoforth is designed to provide a full
on-chip Forth OS, including both workflows where one is using, say,
picocom, GNU Screen, or Tera Term or one is using a dedicated Forth
terminal like zeptocom.js or e4thcom. (Word to the wise ─ zeptoed doesn't
work with zeptocom.js or e4thcom, because it expects a full ANSI terminal
while those do not fully implement such.)
Is there an explanation of error messages somewhere which maps
error messages to possible reason for their appearance?
To be honest I haven't documented the error messages themselves, which
honestly can be a bit cryptic at times. (Often if you see an error message
that does not mean that the actual ultimate cause is reflected in the error
message itself.)
If you want info on them, probably the best approach is to grep the source
code for the error message, which will probably end up leading you to
something that looks like:
: x-my-error ( -- ) ." this is my error message" cr ;
and then grepping the source code for, say, x-my-error, which will lead you
to each place where it can be raised.
A big THANK YOU for your help and patience, Travis!
Cheers!
Tuxic
You're welcome!
Travis
… Message ID: <tabemann/zeptoforth/repo-discussions/108/comments/9920550@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
On 06/30 08:07, tabemann wrote:
On Sun, Jun 30, 2024 at 9:39 PM mcctuxic ***@***.***> wrote:
> I *had* to check this out right before going to work (its 4:34 am in the
> morning/night).
>
> I inserted a 16GB card, which was formatted like the previous one...
> and...It works out-of-the-box! Great!
>
Cool!
I ordered a 2 GB SD card today, and plan on figuring out how to support it
so that people using 2 GB SD cards can use them with zeptoforth.
Travis, your support is super great! Thank you very much for takeing a
look at it.
> This is the first development environment which runs directly on
> the chip and offers such a comfort like zeptoed, which I used right
> after the SDHC/SDHX card was proper recognized!
>
Nice that it worked for you! zeptoforth is designed to provide a full
on-chip Forth OS, including both workflows where one is using, say,
picocom, GNU Screen, or Tera Term or one is using a dedicated Forth
terminal like zeptocom.js or e4thcom. (Word to the wise ─ zeptoed doesn't
work with zeptocom.js or e4thcom, because it expects a full ANSI terminal
while those do not fully implement such.)
I am a Linux-only person - I am using kitty as terminal emulator and
picocom to contact a big and full zeptoforth on my Pi Pico via usb.
> Is there an explanation of error messages somewhere which maps
> error messages to possible reason for their appearance?
>
To be honest I haven't documented the error messages themselves, which
honestly can be a bit cryptic at times. (Often if you see an error message
that does not mean that the actual ultimate cause is reflected in the error
message itself.)
If you want info on them, probably the best approach is to grep the source
code for the error message, which will probably end up leading you to
something that looks like:
: x-my-error ( -- ) ." this is my error message" cr ;
and then grepping the source code for, say, x-my-error, which will lead you
to each place where it can be raised.
I did that already ... but I still a beginner so not everything was
clear to me....will see. :)
> A big THANK YOU for your help and patience, Travis!
>
> Cheers!
> Tuxic
You're welcome!
:)
Travis
> Message ID: <tabemann/zeptoforth/repo-discussions/108/comments/9920550@
> github.com>
Cheers!
Tuxic
…
--
Reply to this email directly or view it on GitHub:
#108 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi,
I am confused... :)
To make live a little easier when starting with zeptoforth I bought a Cyton Maker Pi Pico board, which includes beside some other convenient things a SDcard slot attached to GPIO pins of the Pi Pico (Pi Pico W in my case).
You recommended me to use zeptoed, which edits files on a SDcard. Perfect match!
But at the moment I cannot decide, whether the manufacturer has wired the SDcard slot the wrong way, or I am not understanding the whole thing.
The schematics of the board can be found here:
https://www.cytron.io/p-maker-pi-pico-base at the bottom of the page at "Resources".
According to the schematics the "CS" pin of SPI1 is connected to GPIO 15.
According to the Pi Pico W GPIO 15 is NOT related to SPI1/CS but to SPI1/TX.
BUT :) When I insert a SD card into the slot, the GPIO15-led of the board lights up.
Is it possible, that Cyto has hardwired CS to the card-is-inserted-into-slot switch and this is feed
back to GPIO 15 as an indicator for a card being inserted. "CS the other way around" so to say.
And: How can I tell zeptoforth about this setup.
I am asking first before trying anything, because I don't want to fry a GPIO pin with the wrong setup...
Cheers!
Tuxic
Beta Was this translation helpful? Give feedback.
All reactions