carlk3 / FreeRTOS-FAT-CLI-for-RPi-Pico

Project to add SD cards as peripherals on Raspberry Pi Pico.
Apache License 2.0
43 stars 12 forks source link

Incompatibility on PICO-W. Just linking with the wifi driver breaks wifi #26

Open tgiacchi opened 9 months ago

tgiacchi commented 9 months ago

Using the simple spi example and taking the startup code from the basic wifi-iperf example, after a bit of struggling, it will compile. However, wifi will not connect. If the startup code for wifi is not linked with the FAT library it works fine. The FAT code isn't even being called (commented out) it still won't connect. I've tried moving to the latest version of FreeRTOS (11.01) but that causes all sorts of other headaches.

Have you been able to get wifi working? If so, can you please post an example?

carlk3 commented 9 months ago

I'll take a look at it. The first thing I would look for is conflicts on the GPIOs:

Note that GPIO25 is the PICO_DEFAULT_LED_PIN on Pico Classic! See https://github.com/carlk3/no-OS-FatFS-SD-SPI-RPi-Pico/issues/74.

tgiacchi commented 9 months ago

I appreciate you looking into this. The GPIOs aren't in conflict. I moved everything to spi1 so no conflict with pins. I made sure

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Carl J Kugler III @.> Sent: Saturday, January 13, 2024 1:39:21 PM To: carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico @.> Cc: Tom @.>; Author @.> Subject: Re: [carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico] Incompatibility on PICO-W. Just linking with the wifi driver breaks wifi (Issue #26)

I'll take a look at it. The first thing I would look for is conflicts on the GPIOs:

Note that GPIO25 is the PICO_DEFAULT_LED_PIN on Pico Classic! See carlk3/no-OS-FatFS-SD-SPI-RPi-Pico#74https://github.com/carlk3/no-OS-FatFS-SD-SPI-RPi-Pico/issues/74.

— Reply to this email directly, view it on GitHubhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/issues/26#issuecomment-1890685591, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADNHM6AM2TVXCOXGWSIAESTYOLIFTAVCNFSM6AAAAABBYRLE32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJQGY4DKNJZGE. You are receiving this because you authored the thread.Message ID: @.***>

carlk3 commented 9 months ago

I pushed an example to the dev branch.

tgiacchi commented 9 months ago

Thanks for posting the iperf example. What version of freertos did you build with? It won't compile on the LTS 10.x branch.

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Carl J Kugler III @.> Sent: Sunday, January 14, 2024 1:33:22 AM To: carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico @.> Cc: Tom @.>; Author @.> Subject: Re: [carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico] Incompatibility on PICO-W. Just linking with the wifi driver breaks wifi (Issue #26)

I pushed an example https://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/tree/dev/examples/iperf to the devhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/tree/dev branch.

— Reply to this email directly, view it on GitHubhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/issues/26#issuecomment-1890862900, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADNHM6CO7GSGWCAYMQVMI53YON33FAVCNFSM6AAAAABBYRLE32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJQHA3DEOJQGA. You are receiving this because you authored the thread.Message ID: @.***>

tgiacchi commented 9 months ago

I had to switch to single core as SMP version won't compile. And once it compiles, after making sure it was using SPI1, it finds the card but goes into an infinite loop of restarting the main_task. The restart happens when doing the network connect. It never returns from that call.

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Carl J Kugler III @.> Sent: Sunday, January 14, 2024 1:33:22 AM To: carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico @.> Cc: Tom @.>; Author @.> Subject: Re: [carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico] Incompatibility on PICO-W. Just linking with the wifi driver breaks wifi (Issue #26)

I pushed an example https://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/tree/dev/examples/iperf to the devhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/tree/dev branch.

— Reply to this email directly, view it on GitHubhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/issues/26#issuecomment-1890862900, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADNHM6CO7GSGWCAYMQVMI53YON33FAVCNFSM6AAAAABBYRLE32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJQHA3DEOJQGA. You are receiving this because you authored the thread.Message ID: @.***>

carlk3 commented 9 months ago

It won't compile on the LTS 10.x branch.

What error messages are you seeing?

carlk3 commented 9 months ago

What version of freertos did you build with?

I just pulled the latest from https://github.com/FreeRTOS/FreeRTOS and it builds and runs OK for me. What toolchain are you using? I'm using GCC 10.3.1 arm-none-eabi.

carlk3 commented 9 months ago

Strangely, pulling the latest from https://github.com/FreeRTOS/FreeRTOS does not seem to get FreeRTOS-Kernel V11. At least, not according to tskKERNEL_VERSION_NUMBER in task.h. So, I downloaded V11.0.1 instead. That shows tskKERNEL_VERSION_NUMBER "V11.0.1". I'm able to build and run that with no problems.

tgiacchi commented 9 months ago

SMP or single core?

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Carl J Kugler III @.> Sent: Sunday, January 14, 2024 4:19:53 PM To: carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico @.> Cc: Tom @.>; Author @.> Subject: Re: [carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico] Incompatibility on PICO-W. Just linking with the wifi driver breaks wifi (Issue #26)

Strangely, pulling the latest from https://github.com/FreeRTOS/FreeRTOS does not seem to get FreeRTOS-Kernel V11. At least, not according to tskKERNEL_VERSION_NUMBER in task.h. So, I downloaded V11.0.1https://github.com/FreeRTOS/FreeRTOS-Kernel/releases/tag/V11.0.1 instead. That shows tskKERNEL_VERSION_NUMBER "V11.0.1". I'm able to build and run that with no problems.

— Reply to this email directly, view it on GitHubhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/issues/26#issuecomment-1891075277, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADNHM6CWK2EQ3YC6KZFPPMTYORDXTAVCNFSM6AAAAABBYRLE32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJRGA3TKMRXG4. You are receiving this because you authored the thread.Message ID: @.***>

tgiacchi commented 9 months ago

12.3.1

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Carl J Kugler III @.> Sent: Sunday, January 14, 2024 3:19:58 PM To: carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico @.> Cc: Tom @.>; Author @.> Subject: Re: [carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico] Incompatibility on PICO-W. Just linking with the wifi driver breaks wifi (Issue #26)

What version of freertos did you build with? I just pulled the latest from https://github.com/FreeRTOS/FreeRTOS and it builds and runs OK for me. What toolchain are you using? I'm using GCC 10.3.1 arm-none-eabi.

— Reply to this email directly, view it on GitHubhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/issues/26#issuecomment-1891061927, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADNHM6GVTDA523YWCMKBLLLYOQ4W5AVCNFSM6AAAAABBYRLE32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJRGA3DCOJSG4. You are receiving this because you authored the thread.Message ID: @.***>

tgiacchi commented 9 months ago

I will repull your dev branch tomorrow and I already have 11.01 . Are you building SMP?

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Carl J Kugler III @.> Sent: Sunday, January 14, 2024 4:19:53 PM To: carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico @.> Cc: Tom @.>; Author @.> Subject: Re: [carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico] Incompatibility on PICO-W. Just linking with the wifi driver breaks wifi (Issue #26)

Strangely, pulling the latest from https://github.com/FreeRTOS/FreeRTOS does not seem to get FreeRTOS-Kernel V11. At least, not according to tskKERNEL_VERSION_NUMBER in task.h. So, I downloaded V11.0.1https://github.com/FreeRTOS/FreeRTOS-Kernel/releases/tag/V11.0.1 instead. That shows tskKERNEL_VERSION_NUMBER "V11.0.1". I'm able to build and run that with no problems.

— Reply to this email directly, view it on GitHubhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/issues/26#issuecomment-1891075277, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADNHM6CWK2EQ3YC6KZFPPMTYORDXTAVCNFSM6AAAAABBYRLE32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJRGA3TKMRXG4. You are receiving this because you authored the thread.Message ID: @.***>

carlk3 commented 9 months ago

SMP or single core?

The kernel has SMP built in now (no separate branch). The FreeRTOSConfig.h in that example is set up for SMP.

tgiacchi commented 9 months ago

Better. Builds properly. Runs when built as release with symbols for debugging. Hangs when built as debug. Using visualgdb.

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Carl J Kugler III @.> Sent: Sunday, January 14, 2024 8:59:48 PM To: carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico @.> Cc: Tom @.>; Author @.> Subject: Re: [carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico] Incompatibility on PICO-W. Just linking with the wifi driver breaks wifi (Issue #26)

SMP or single core? The kernel has SMP built in now (no separate branch). The FreeRTOSConfig.h in that example is set up for SMP.

— Reply to this email directly, view it on GitHubhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/issues/26#issuecomment-1891187756, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADNHM6GXSF7F2HM7KW2DR2LYOSERJAVCNFSM6AAAAABBYRLE32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJRGE4DONZVGY. You are receiving this because you authored the thread.Message ID: @.***>

carlk3 commented 9 months ago

Hangs when built as debug.

Where (GDB backtrace, or, literally, where) does it hang?

tgiacchi commented 9 months ago

In the connect code itself down in the cyw43 driver.

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Carl J Kugler III @.> Sent: Monday, January 15, 2024 1:59:47 PM To: carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico @.> Cc: Tom @.>; Author @.> Subject: Re: [carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico] Incompatibility on PICO-W. Just linking with the wifi driver breaks wifi (Issue #26)

Hangs when built as debug.

Where (GDB backtrace, or, literally, where) does it hang?

— Reply to this email directly, view it on GitHubhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/issues/26#issuecomment-1892652133, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADNHM6BNEE34NHGTZN6JZLLYOV4CHAVCNFSM6AAAAABBYRLE32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJSGY2TEMJTGM. You are receiving this because you authored the thread.Message ID: @.***>

carlk3 commented 8 months ago

In the connect code itself down in the cyw43 driver.

What is that code trying to do? Could you post the backtrace?

You could try selectively commenting out parts of the code I added to picow_freertos_iperf.c:

diff pico-examples/pico_w/wifi/freertos/iperf/picow_freertos_iperf.c picow_freertos_iperf.c 
15a16,20
> //
> #include "ff_headers.h"
> #include "ff_sddisk.h"
> #include "ff_stdio.h"
> #include "ff_utils.h"
27a33,60
> int log_printf(const char *fmt, ...) {
>     char buf[256] = {0};
>     va_list args;
>     va_start(args, fmt);
>     int cw = vsnprintf(buf, sizeof(buf), fmt, args);
>     va_end(args);
> 
>     printf("%s", buf);
> 
>     FF_FILE *pxFile = ff_fopen("/sd0/filename.txt", "a");
>     if (!pxFile) {
>         FF_PRINTF("ff_fopen failed: %s (%d)\n", strerror(stdioGET_ERRNO()),
>                   stdioGET_ERRNO());
>         exit(1);
>     }
>     if (ff_fprintf(pxFile, "%s", buf) < 0) {
>         FF_PRINTF("ff_fprintf failed: %s (%d)\n", strerror(stdioGET_ERRNO()),
>                   stdioGET_ERRNO());
>         exit(1);
>     }
>     if (-1 == ff_fclose(pxFile)) {
>         FF_PRINTF("ff_fclose failed: %s (%d)\n", strerror(stdioGET_ERRNO()),
>                   stdioGET_ERRNO());
>         exit(1);
>     }
>     return cw;
> }
> 
38,39c71,72
<     printf("Completed iperf transfer of %d MBytes @ %.1f Mbits/sec\n", mbytes, mbits);
<     printf("Total iperf megabytes since start %d Mbytes\n", total_iperf_megabytes);
---
>     log_printf("Completed iperf transfer of %d MBytes @ %.1f Mbits/sec\n", mbytes, mbits);
>     log_printf("Total iperf megabytes since start %d Mbytes\n", total_iperf_megabytes);
59a93,102
>     
>     FF_Disk_t *pxDisk = FF_SDDiskInit("sd0");
>     configASSERT(pxDisk);
>     FF_Error_t e = FF_Mount(pxDisk, 0);
>     if (FF_ERR_NONE != e) {
>         FF_PRINTF("FF_Mount error: %s\n", FF_GetErrMessage(e));
>         exit(1);
>     }
>     FF_FS_Add("/sd0", pxDisk);
> 
65c108
<     printf("Connecting to Wi-Fi...\n");
---
>     printf("Connecting to %s...\n", WIFI_SSID);
carlk3 commented 8 months ago

I forgot to bump up the task stack size in the picow_freertos_iperf example to accommodate calls to the filesystem. I think it was overrunning the stack, which might explain the hang you saw. I have pushed a change to the dev branch.

tgiacchi commented 8 months ago

I fixed that too. I'm digging in further when I have time. For now I need to get some code working, so I am building release with debug info to move forward. May be related to usb printing.

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Carl J Kugler III @.> Sent: Monday, January 15, 2024 11:20:37 PM To: carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico @.> Cc: Tom @.>; Author @.> Subject: Re: [carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico] Incompatibility on PICO-W. Just linking with the wifi driver breaks wifi (Issue #26)

I forgot to bump up the task stack size in the picow_freertos_iperf example to accommodate calls to the filesystem. I think it was overrunning the stack, which might explain the hang you saw. I have pushed a change to the devhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/tree/dev branch.

— Reply to this email directly, view it on GitHubhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/issues/26#issuecomment-1893048000, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADNHM6AHXPMMXITXAPYKZ63YOX5ZLAVCNFSM6AAAAABBYRLE32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJTGA2DQMBQGA. You are receiving this because you authored the thread.Message ID: @.***>

tgiacchi commented 8 months ago

Looks like PH1 breaks on the SP micro cards which is what you are seeing.

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Carl J Kugler III @.> Sent: Monday, January 15, 2024 11:20:37 PM To: carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico @.> Cc: Tom @.>; Author @.> Subject: Re: [carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico] Incompatibility on PICO-W. Just linking with the wifi driver breaks wifi (Issue #26)

I forgot to bump up the task stack size in the picow_freertos_iperf example to accommodate calls to the filesystem. I think it was overrunning the stack, which might explain the hang you saw. I have pushed a change to the devhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/tree/dev branch.

— Reply to this email directly, view it on GitHubhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/issues/26#issuecomment-1893048000, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADNHM6AHXPMMXITXAPYKZ63YOX5ZLAVCNFSM6AAAAABBYRLE32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJTGA2DQMBQGA. You are receiving this because you authored the thread.Message ID: @.***>

tgiacchi commented 8 months ago

Are you using the Snoop mode of dma to do the crc?

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Carl J Kugler III @.> Sent: Monday, January 15, 2024 11:20:37 PM To: carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico @.> Cc: Tom @.>; Author @.> Subject: Re: [carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico] Incompatibility on PICO-W. Just linking with the wifi driver breaks wifi (Issue #26)

I forgot to bump up the task stack size in the picow_freertos_iperf example to accommodate calls to the filesystem. I think it was overrunning the stack, which might explain the hang you saw. I have pushed a change to the devhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/tree/dev branch.

— Reply to this email directly, view it on GitHubhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/issues/26#issuecomment-1893048000, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADNHM6AHXPMMXITXAPYKZ63YOX5ZLAVCNFSM6AAAAABBYRLE32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJTGA2DQMBQGA. You are receiving this because you authored the thread.Message ID: @.***>

tgiacchi commented 8 months ago

Found a little more out. Once the wifi stack is running,the filesystem access has to be wrapped in Cyw43_arch_lwip_begin and also _end. Otherwise random hangs happen. Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Carl J Kugler III @.> Sent: Monday, January 15, 2024 11:20:37 PM To: carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico @.> Cc: Tom @.>; Author @.> Subject: Re: [carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico] Incompatibility on PICO-W. Just linking with the wifi driver breaks wifi (Issue #26)

I forgot to bump up the task stack size in the picow_freertos_iperf example to accommodate calls to the filesystem. I think it was overrunning the stack, which might explain the hang you saw. I have pushed a change to the devhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/tree/dev branch.

— Reply to this email directly, view it on GitHubhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/issues/26#issuecomment-1893048000, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADNHM6AHXPMMXITXAPYKZ63YOX5ZLAVCNFSM6AAAAABBYRLE32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJTGA2DQMBQGA. You are receiving this because you authored the thread.Message ID: @.***>

carlk3 commented 8 months ago

Are you using the Snoop mode of dma to do the crc?

No. I did look into it; see Suggestion for calculating CRC/etc #63. As it stands today, "most" of the CRC calculation is overlapped with the DMA transfer anyway, so doesn't cost anything unless both cores have something better to do during the DMA transfer. I say "most" because the CRC calculations for the first 512 byte block when writing, or the last 512 byte block when reading, can't be pipelined.

However, there is some room for improvement in the CRC calculations. In particular, I've been looking at slicing-by-8. I don't think it would make a significant difference right now, but I'm looking at eMMC. That has additional bus modes that could open up some possibilities:

  1. By using the 8 bit interface instead of the 4 bit SD interface, the transfer rate could potentially be doubled.
  2. Dual Data Rate (DDR): clocks the data on the rising AND falling edges of the clock. SD has DDR, but only for 1.8 V signaling. eMMC has a DDR mode that uses 3.3 V signaling. Another potential doubling of the transfer rate.

I could see CRC becoming a bottleneck if the transfer speeds can be quadrupled!

EDIT: Also, note that CRC is optional for the SPI, if you're in a hurry and not all that worried about data integrity. You can use a compilation directive to turn it off. E.g., in CMakeLists.txt:

# Disable CRC checking for SPI-attached cards.
add_compile_definitions(SD_CRC_ENABLED=0)
tgiacchi commented 8 months ago

Nice.

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Carl J Kugler III @.> Sent: Tuesday, January 16, 2024 5:31:00 PM To: carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico @.> Cc: Tom @.>; Author @.> Subject: Re: [carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico] Incompatibility on PICO-W. Just linking with the wifi driver breaks wifi (Issue #26)

Are you using the Snoop mode of dma to do the crc?

No. I did look into it; see Suggestion for calculating CRC/etc #63https://github.com/carlk3/no-OS-FatFS-SD-SPI-RPi-Pico/issues/63. As it stands today, "most" of the CRC calculation is overlapped with the DMA transfer anyway, so doesn't cost anything unless both cores have something better to do during the DMA transfer. I say "most" because the CRC calculations for the first 512 byte block when writing, or the last 512 byte block when reading, can't be pipelined.

However, there is some room for improvement in the CRC calculations. In particular, I've been looking at slicing-by-8https://github.com/mattsta/crcspeed. I don't think it would make a significant difference right now, but I'm looking at eMMC. That has additional bus modes that could open up some possibilities:

  1. By using the 8 bit interface instead of the 4 bit SD interface transfer rate, the transfer rate could potentially be doubled.
  2. Dual Data Rate (DDR): clocks the data on the rising AND falling edges of the clock. SD has DDR, but only for 1.8 V signaling. eMMC has a DDR mode that uses 3.3 V signaling. Another potential doubling of the transfer rate.

I could see CRC becoming a bottleneck if the transfer speeds can be quadrupled!

— Reply to this email directly, view it on GitHubhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/issues/26#issuecomment-1894626328, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADNHM6C73DEDNVKLMSUSHI3YO35SJAVCNFSM6AAAAABBYRLE32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJUGYZDMMZSHA. You are receiving this because you authored the thread.Message ID: @.***>

carlk3 commented 8 months ago

I created a repo and gave you access.

If I go to https://github.com/tgiacchi I only see "tgiacchi doesn't have any public repositories yet."

tgiacchi commented 8 months ago

I added you as a collaborator on tgiacchi/a2pWifi1: crashing version (github.com)https://github.com/tgiacchi/a2pWifi1 . It is waiting for your response.

Sent from Outlookhttp://aka.ms/weboutlook From: Carl J Kugler III @.> Sent: Wednesday, January 17, 2024 11:47 AM To: carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico @.> Cc: Tom @.>; Author @.> Subject: Re: [carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico] Incompatibility on PICO-W. Just linking with the wifi driver breaks wifi (Issue #26)

I created a repo and gave you access.

If I go to https://github.com/tgiacchi I only see "tgiacchi doesn't have any public repositories yet."

- Reply to this email directly, view it on GitHubhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/issues/26#issuecomment-1896201498, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADNHM6EFPUC356L2CKV7XVLYO76CDAVCNFSM6AAAAABBYRLE32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJWGIYDCNBZHA. You are receiving this because you authored the thread.Message ID: @.**@.>>

carlk3 commented 8 months ago

OK, I'll take a look.

In the meantime, I have added a new example: examples/pico_w/httpd demonstrates an WiFi web server serving files from an SD card.

tgiacchi commented 8 months ago

I'll take a look. Does it use the socket api?

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Carl J Kugler III @.> Sent: Wednesday, January 17, 2024 7:09:36 PM To: carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico @.> Cc: Tom @.>; Author @.> Subject: Re: [carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico] Incompatibility on PICO-W. Just linking with the wifi driver breaks wifi (Issue #26)

OK, I'll take a look.

In the meantime, I have added a new example: examples/pico_w/httpdhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/tree/dev/examples/pico_w/httpd demonstrates an WiFi web server serving files from an SD card.

— Reply to this email directly, view it on GitHubhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/issues/26#issuecomment-1897523910, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADNHM6CARWT5XS3WR3B4ZTLYPBR4BAVCNFSM6AAAAABBYRLE32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJXGUZDGOJRGA. You are receiving this because you authored the thread.Message ID: @.***>

carlk3 commented 8 months ago

I think it does, under the covers. I'm just extending the lwip httpd.

Re: a2pWifi1: Do you have to run at 157500 kHz? Maybe you could try commenting out sys.Init(); until you get some more things debugged. I have no idea if lwip has any dependencies of the clock frequencies.

carlk3 commented 8 months ago

Also, I recently made a change to FreeRTOSConfig.h in my examples:

#define configRUN_MULTIPLE_PRIORITIES           0

to

#define configRUN_MULTIPLE_PRIORITIES           1

If configRUN_MULTIPLE_PRIORITIES is defined as 1, multiple tasks with different priorities may run simultaneously - so a higher and lower priority task may run on different cores at the same time.

Unless you have a need to prevent a lower priority task running on one core at the same time as a higher priority task runs on another core, you probably want to set that to 1. I didn't notice that when I copied some settings from some pico-example.

tgiacchi commented 8 months ago

Clock and periclock make no difference. I have the sockets stuff running without sdcard at those speeds and sending data non-stop. I also tried the code I shared at default clocks, same problem.

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Carl J Kugler III @.> Sent: Wednesday, January 17, 2024 9:43:20 PM To: carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico @.> Cc: Tom @.>; Author @.> Subject: Re: [carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico] Incompatibility on PICO-W. Just linking with the wifi driver breaks wifi (Issue #26)

I think it does, under the covers. I'm just extending the lwip httpd.

Re: a2pWifi1: Do you have to run at 157500 kHz? Maybe you could try commenting out sys.Init(); until you get some more things debugged. I have no idea if lwip has any dependencies of the clock frequencies.

— Reply to this email directly, view it on GitHubhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/issues/26#issuecomment-1897680375, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADNHM6BWC2W4N7UTGZ2JOBDYPCD4RAVCNFSM6AAAAABBYRLE32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJXGY4DAMZXGU. You are receiving this because you authored the thread.Message ID: @.***>

tgiacchi commented 8 months ago

Did things the hard old fashioned way. Set up 2 probes and two pico w. Ran my basic socket code on 1 and the fat code on the other. Changed lwipopts to match, same with common. That fixed 1 issue. Continued then with 1 rtosconfig differences 1 at a time until things worked. So now it seems to work.

I'll post the latest code to the branch later today.

Do you have any way of sharing the SPI instance while not in the spi driver? I need to use the SPI for pico to pico communication.

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Carl J Kugler III @.> Sent: Wednesday, January 17, 2024 11:51:52 PM To: carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico @.> Cc: Tom @.>; Author @.> Subject: Re: [carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico] Incompatibility on PICO-W. Just linking with the wifi driver breaks wifi (Issue #26)

Also, I recently made a change to FreeRTOSConfig.h in my examples:

define configRUN_MULTIPLE_PRIORITIES 0

to

define configRUN_MULTIPLE_PRIORITIES 1

If configRUN_MULTIPLE_PRIORITIES is defined as 1, multiple tasks with different priorities may run simultaneously - so a higher and lower priority task may run on different cores at the same time.

Unless you have a need to prevent a lower priority task running on one core at the same time as a higher priority task runs on another core, you probably want to set that to 1. I didn't notice that when I copied some settings from some pico-example.

— Reply to this email directly, view it on GitHubhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/issues/26#issuecomment-1897793336, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADNHM6BHRBK7PRXUP2BALODYPCS6RAVCNFSM6AAAAABBYRLE32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJXG44TGMZTGY. You are receiving this because you authored the thread.Message ID: @.***>

carlk3 commented 8 months ago

Do you have any way of sharing the SPI instance while not in the spi driver? I need to use the SPI for pico to pico communication.

You have a few options there.

tgiacchi commented 8 months ago

Think I'll redesign and use sdio. Then spi1 is available. More things to test. Ugh.

Btw, I do appreciate the help!

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Carl J Kugler III @.> Sent: Thursday, January 18, 2024 1:07:11 PM To: carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico @.> Cc: Tom @.>; Author @.> Subject: Re: [carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico] Incompatibility on PICO-W. Just linking with the wifi driver breaks wifi (Issue #26)

Do you have any way of sharing the SPI instance while not in the spi driver? I need to use the SPI for pico to pico communication.

You have a few options there.

void spi_lock(spi_t spi_p); void spi_unlock(spi_t spi_p);

(portable\RP2040\SPI\spi.h)

— Reply to this email directly, view it on GitHubhttps://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/issues/26#issuecomment-1898971832, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADNHM6DET7POXGR7YRA5RTDYPFQE7AVCNFSM6AAAAABBYRLE32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJYHE3TCOBTGI. You are receiving this because you authored the thread.Message ID: @.***>