July 02, 2025, 04:06:28 AM

Recent posts

#1
ESP32 / Re: ESP32-SBC-FabGL .. PCemula...
Last post by therese80 - Today at 12:43:40 AM
hi ,
make several test ...

format my sdcard in fat32
write text file using my laptop

rp2040-pico-pc : ok read/write
esp32-sbc-fabgl : mount failed ..

i make a simple arduino programme(platformio) to mount/write/read SDCARD
esp32-sbc-fabgl : [  6053][E][sd_diskio.cpp:806] sdcard_mount(): f_mount failed: (3) The physical drive cannot work

annex : programme test SDCARD
Board defect ?

@+
TRS80

#define LED_YELLOW 2
#define HSPI_SCK 14
#define HSPI_MISO 35
#define HSPI_MOSI 12
#define SD_CS 13

#include "FS.h"
#include "SD.h"
#include "SPI.h"

SPIClass * hspi = NULL;



void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
    Serial.printf("Listing directory: %s\n", dirname);

    File root = fs.open(dirname);
    if(!root){
        Serial.println("Failed to open directory");
        return;
    }
    if(!root.isDirectory()){
        Serial.println("Not a directory");
        return;
    }

    File file = root.openNextFile();
    while(file){
        if(file.isDirectory()){
            Serial.print("  DIR : ");
            Serial.println(file.name());
            if(levels){
                listDir(fs, file.name(), levels -1);
            }
        } else {
            Serial.print("  FILE: ");
            Serial.print(file.name());
            Serial.print("  SIZE: ");
            Serial.println(file.size());
        }
        file = root.openNextFile();
    }
}

void createDir(fs::FS &fs, const char * path){
    Serial.printf("Creating Dir: %s\n", path);
    if(fs.mkdir(path)){
        Serial.println("Dir created");
    } else {
        Serial.println("mkdir failed");
    }
}

void removeDir(fs::FS &fs, const char * path){
    Serial.printf("Removing Dir: %s\n", path);
    if(fs.rmdir(path)){
        Serial.println("Dir removed");
    } else {
        Serial.println("rmdir failed");
    }
}

void readFile(fs::FS &fs, const char * path){
    Serial.printf("Reading file: %s\n", path);

    File file = fs.open(path);
    if(!file){
        Serial.println("Failed to open file for reading");
        return;
    }

    Serial.print("Read from file: ");
    while(file.available()){
        Serial.write(file.read());
    }
    file.close();
}

void writeFile(fs::FS &fs, const char * path, const char * message){
    Serial.printf("Writing file: %s\n", path);

    File file = fs.open(path, FILE_WRITE);
    if(!file){
        Serial.println("Failed to open file for writing");
        return;
    }
    if(file.print(message)){
        Serial.println("File written");
    } else {
        Serial.println("Write failed");
    }
    file.close();
}

void appendFile(fs::FS &fs, const char * path, const char * message){
    Serial.printf("Appending to file: %s\n", path);

    File file = fs.open(path, FILE_APPEND);
    if(!file){
        Serial.println("Failed to open file for appending");
        return;
    }
    if(file.print(message)){
        Serial.println("Message appended");
    } else {
        Serial.println("Append failed");
    }
    file.close();
}

void renameFile(fs::FS &fs, const char * path1, const char * path2){
    Serial.printf("Renaming file %s to %s\n", path1, path2);
    if (fs.rename(path1, path2)) {
        Serial.println("File renamed");
    } else {
        Serial.println("Rename failed");
    }
}

void deleteFile(fs::FS &fs, const char * path){
    Serial.printf("Deleting file: %s\n", path);
    if(fs.remove(path)){
        Serial.println("File deleted");
    } else {
        Serial.println("Delete failed");
    }
}

void testFileIO(fs::FS &fs, const char * path){
    File file = fs.open(path);
    static uint8_t buf[512];
    size_t len = 0;
    uint32_t start = millis();
    uint32_t end = start;
    if(file){
        len = file.size();
        size_t flen = len;
        start = millis();
        while(len){
            size_t toRead = len;
            if(toRead > 512){
                toRead = 512;
            }
            file.read(buf, toRead);
            len -= toRead;
        }
        end = millis() - start;
        Serial.printf("%u bytes read for %u ms\n", flen, end);
        file.close();
    } else {
        Serial.println("Failed to open file for reading");
    }


    file = fs.open(path, FILE_WRITE);
    if(!file){
        Serial.println("Failed to open file for writing");
        return;
    }

    size_t i;
    start = millis();
    for(i=0; i<2048; i++){
        file.write(buf, 512);
    }
    end = millis() - start;
    Serial.printf("%u bytes written for %u ms\n", 2048 * 512, end);
    file.close();
}

void setup(){
    Serial.begin(115200);
    pinMode(LED_YELLOW,OUTPUT);
    digitalWrite(LED_YELLOW, LOW);  // active LOW
    delay(5000);
    hspi = new SPIClass(HSPI);

    hspi->begin(HSPI_SCK, HSPI_MISO, HSPI_MOSI, SD_CS);
    //hspi->begin();
   
   
    if(!SD.begin(SD_CS, *hspi)){
        Serial.println("Card Mount Failed");
        return;
    }
    uint8_t cardType = SD.cardType();

    if(cardType == CARD_NONE){
        Serial.println("No SD card attached");
        return;
    }

    Serial.print("SD Card Type: ");
    if(cardType == CARD_MMC){
        Serial.println("MMC");
    } else if(cardType == CARD_SD){
        Serial.println("SDSC");
    } else if(cardType == CARD_SDHC){
        Serial.println("SDHC");
    } else {
        Serial.println("UNKNOWN");
    }

    uint64_t cardSize = SD.cardSize() / (1024 * 1024);
    Serial.printf("SD Card Size: %lluMB\n", cardSize);

    listDir(SD, "/", 0);
    createDir(SD, "/mydir");
    listDir(SD, "/", 0);
    removeDir(SD, "/mydir");
    listDir(SD, "/", 2);
    writeFile(SD, "/hello.txt", "Hello ");
    appendFile(SD, "/hello.txt", "World!\n");
    readFile(SD, "/hello.txt");
    deleteFile(SD, "/foo.txt");
    renameFile(SD, "/hello.txt", "/foo.txt");
    readFile(SD, "/foo.txt");
    testFileIO(SD, "/test.txt");
    Serial.printf("Total space: %lluMB\n", SD.totalBytes() / (1024 * 1024));
    Serial.printf("Used space: %lluMB\n", SD.usedBytes() / (1024 * 1024));
    digitalWrite(LED_YELLOW, HIGH);  // active LOW   

}

void loop(){

}
#2
ESP32 / Re: ESP32-SBC-FabGL .. PCemula...
Last post by therese80 - July 01, 2025, 04:00:14 PM
Hi LubOlimex ,
thanks a lot for the answer .
In the code of PCEmulator( fork of Olimex)

Error is generated at line 391 :: try to mount sdcard with "FileBrowser::mountSDCard"

the default value are :



Parameters:
formatOnFail – Formats SD Card when it cannot be mounted.
mountPath – Mount directory (ex. "/sdcard").
maxFiles – Number of files that can be open at the time (default 4).
allocationUnitSize – Allocation unit size (default 16K).
MISO – Pin for MISO signal (default 16 for WROOM-32, 2 for PICO-D4).
MOSI – Pin for MOSI signal (default 17 for WROOM-32, 12 for PICO-D4).
CLK – Pin for CLK signal (default 14).
CS – Pin for CS signal (default 13).

i replaced with value that's you have suggested ::

if (!FileBrowser::mountSDCard(false, SD_MOUNT_PATH, 8,35,12,14,13))   // @TODO: reduce to 4?

Always same error ...

I investigate on the content of the sdcard and image downloaded ..

@

trs80 aka therese80
#3
A20 / Re: OLinuXimo A20 LIME2 : use ...
Last post by abriotde - July 01, 2025, 03:50:14 PM
I tested with WiringPi... and it run, but do not work... But it work like pyA20Lime2 : with open() in /dev/mem.
To work, we just have to add "O_SYNC | O_CLOEXEC" to open() parameters.
Then mmap() fail, but again, if we change addr_start parameter from 0x1c20000 to 0x20200000, it "work".

In fact I suppose, that I miss-use WiringPi. Maybe is it an other port number witch I should use. Maybe is it an other parmater witch is wrong, because it is design for Raspberry PI. (addr_start for mmap()? Port number? An other parameter?).

I tried some configurations but without success for the moment.
#4
A20 / Re: Issue with UART Communicat...
Last post by LubOlimex - July 01, 2025, 11:47:25 AM
QuoteHowever, I'm not receiving any data on the specified UART pins.

Which exactly are the "specified UART pins"?

Also what do you use to read to the "specified UART pins"?
#5
A20 / Issue with UART Communication ...
Last post by mcgraw - July 01, 2025, 10:48:25 AM
Hello, I'm currently working with the ESP32-POE-ISO module and facing an issue with UART communication. I've set up the following code to initialize UART:

#include "driver/uart.h"

void app_main() {
    uart_config_t uart_config = {
        .baud_rate = 115200,
        .data_bits = UART_DATA_8_BITS,
        .parity = UART_PARITY_DISABLE,
        .stop_bits = UART_STOP_BITS_1,
        .flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
    };
    uart_driver_install(UART_NUM_1, 2048, 0, 0, NULL, 0);
    uart_param_config(UART_NUM_1, &uart_config);
}
However, I'm not receiving any data on the specified UART pins. Could this be a pin configuration issue, or is there something else I might be missing?
#6
New Products release / RP2350pc Open Source Hardware ...
Last post by olimex - July 01, 2025, 10:25:51 AM
RP2350pc is Open Source Hardware all in one computer with Dual Core ARM/RISCV processor, 8MB RAM, 16MB Flash, Audio Codec, Four USB hosts, DVI/HDMI video, LiPo UPS, Two UEXT connectors https://olimex.wordpress.com/2025/07/01/rp2350pc-open-source-hardware-all-in-one-computer-with-rp2350b-8mb-psram-16mb-flash-four-usb-host-dvi-hdmi-output-and-audio-codec-for-retro-computer-emulation-and-education/ #oshw #raspberrypi #pico2 #retrocomputer #retrogaming #apple2 #oric
#7
ESP32 / Re: ESP32-PoE-ISO epaper and E...
Last post by LubOlimex - June 30, 2025, 11:10:34 AM
No, the pins you use for display and SPI are not related to the pins of the Ethernet.

But the error message you get "task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:" is strange. Maybe some of the software needs some extra delay? Can the watchdog be disabled and test without it?
#8
A20 / Re: OLinuXimo A20 LIME2 : use ...
Last post by abriotde - June 30, 2025, 10:54:58 AM
I found the cause of the problem : we can't open /dev/mem. To open this we need to set CONFIG_STRICT_DEVMEM to n witch needs to re-compile Linux kernel and witch is quite complex and unsecure.

So I prefer to stay with sysfs.

I good solution should be to enable the use of all done for Arduino (Witch is open-hardware too). For Raspberry PI (Witch is not), there is https://github.com/WiringPi/WiringPi.git to implement basic Arduino function, in order to use all Arduino solutions.

I had a look to wiringPi/wiringPi.c :

* It need Kernel 5.1, Current Olimage use (5.10.180-olimex), so it's OK

* Some features needs Kernel 6.6.47, but it seem optional...

* There is a detection of Raspberry PI version (piBoard() function), maybe should we had a detection of Olimex?

Is there something done to adapt or a Olimex version of that?
#9
ESP32 / Re: ESP32-PoE-ISO epaper and E...
Last post by djkroko - June 30, 2025, 10:02:24 AM
I know that I can't use WiFi and Ethernet at the same time.

If I enable Ethernet then I disable WiFi in the Code.

But it did not work.

Then when I disable the spi and display section in the Code, Ethernet does work without any problems.

So I thought maybe I use Pins for the Display or SPI which I shouldn't use when I want to use Ethernet at the same time.
#10
ESP32 / Re: ESP32-SBC-FabGL .. PCemula...
Last post by LubOlimex - June 30, 2025, 09:02:11 AM
Not sure what does this part means "GPIO 35(according schematic) is not part of SPI", GPI35 is HSPI_MISO in ESP32-SBC-FabGL.

Our board also uses SPI as the original board, it also uses the exact same pins:

MISO: GPI35
MOSI: GPIO12
CLK:  GPIO14
CS:   GPIO13

The problem is somewhere else. Maybe check this project made by a customer:

https://github.com/MrSoxAndShoes/esp32-sbc-fabgl-quick-start