Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

SdFat Lib Wont start using Zephyr with Arduino Giga

19 views
Skip to first unread message

CyberMerln

unread,
Dec 6, 2024, 3:26:36 PM12/6/24
to Developers, KurtE - PJRC (Teensy) Forum
A friend of mine and myself have been experimenting with Zephyr on the Giga R1 using the ArduinoCore-zephyr ( arduino/ArduinoCore-zephyr: Arduino Core based on Zephyr+llext).  We managed to get I2C working as well as Serial on all ports as well as some fixes for Serial (KurtE).  He even manged to get SPI lipping along on SPI and SPI1.  You can see here  I2C, Serial, SPI experiments with Zephyr on Giga - Hardware / GIGA R1 - Arduino Forum and here  MBED->Zephyr status? Beta by end of year? - Hardware - Arduino Forum.

Right now we are trying to get SdFat Library working with pretty much no luck.

With me I loose Serial as soon as the Giga finishes uploading the sketch and I am not seeing anything on the Serial monitor or coming out of Serial1 in terms of errors.  It seems to be failing as soon as I create an instance of the sd card object with 
SdFat sd;
tracing that in the library leads me to 
class SdFs : public SdBase<FsVolume, FsFormatter> {
 public:
};
with SdBase (think its a template class with I believe is hanging since if comment out template it does load but fails on consructing a file (FsFile file):
template<class Vol, class Fmt>
class SdBase : public Vol {
 public:

Kurt has had a little better luck as you can read in  MBED->Zephyr status? Beta by end of year? - Hardware - Arduino Forum.

So question is does anybody have any ideas on fixes, why this is happening etc.

Thanks
Mike

ku...@rockisland.com

unread,
Dec 6, 2024, 4:11:06 PM12/6/24
to Developers

Been awhile since I responded (or received) messages on this mailing list, so I don’t remember if we can still just respond by email…

 

As Mike mentioned, we have been playing around with the ArduinoCore-zephyr build.   With a new pre-alpha setup of a system like this.

I tend to start off with some of the basic primitives, that I often use on different boards.  Things like:  Serial, GPIO, Wire, SPI, and then into some of the other things like Analog, PWM,

 

With SerialX, I was reasonably happy as unlike the MBED release and likewise the UNO R4 releases, this implementation uses a software buffer.  I have not yet done a fully testing of everything, but did find some holes, such as availableForWrite was not implemented, flush() only waited for the software queue to be empty and the like, and updated the code, and issued a pull request.

 

In conjunction with SerialX, I did some testing of IO pins for digital IO. I am glad the github version is a lot more complete then the board manager install version and it looks like most of the pins have been defined.  I have not checked all the pins used to connect the display Shield.   The github install uses the branch manifest-rev in the github user facchinm fork.  It looks like he has two other branches that have been updated more recently.  I did notice that the LEDs pin numbers here do not match the pin numbers used in the MBED version (as also shown on the boards schematic).  If I remember correctly on the schematic it shows them on IO pins 86-88 and on Zephyr I think they are 94-96.

 

I know Mike started with the Wire objects, so I then have been trying to get SPI objects to work.  I have found that currently SPI is very temperamental.    At times just referencing some object that uses SPI anywhere in the sketch and the sketch appears to die at startup.   That is the PC no longer sees a Serial object, nothing is output.  And the happens even before we do anything with that object.

That is, I put the first access of that object after code that prints something and waits for user input, before I touch it (either by having it as a global object or doing a new to create it).

Likewise, I can have code appearing to execute stuff, add in a digitalWrite(5, HIGH); just before it and again the whole GIGA crashes at startup… (Note: earlier in the code I did call pinMode(5, OUTPUT);

 

As Mike mentioned, I started a thread up on the Arduino forum:  MBED->Zephyr status? Beta by end of year? - Hardware - Arduino Forum

Where I have more details as well as several more questions.  Things like:

what are you using to debug?  IDE debugger (I found a missing pieces).  Also, it appears that some debug output can go out on the logical Serial1 object at 115200. 

                Best way to communicate?  Forum? Here?  Create issues on Github for each of these things?   Punt?

 

Thanks in advance,

Kurt

Reply all
Reply to author
Forward
0 new messages