Jump to content
IGNORED

Fujinet Hostslots


Recommended Posts

Hello


With the latest Fujinet firmware, I can only call up 4 host slots. The fifth one fails, Failed to register VFS driver! Apparently, you can only call up 4 hostlots and then it's over. After a reset, the host slot in question goes again, but you can only call up 4 hostlots. So call the first 4 hostlots then reset and you can call the next 4 hostlots. All 8 do not work. Also, the SIO voltage is no longer displayed correctly in the web interface. It always shows only 1.246 V when my Atari is turned on and has booted from the Fujinet. Previously, it had correctly always displayed 4.749V. Not anymore.

Link to comment
Share on other sites

6 hours ago, Pmetzen said:

Hello


With the latest Fujinet firmware, I can only call up 4 host slots. The fifth one fails, Failed to register VFS driver! Apparently, you can only call up 4 hostlots and then it's over. After a reset, the host slot in question goes again, but you can only call up 4 hostlots. So call the first 4 hostlots then reset and you can call the next 4 hostlots. All 8 do not work. Also, the SIO voltage is no longer displayed correctly in the web interface. It always shows only 1.246 V when my Atari is turned on and has booted from the Fujinet. Previously, it had correctly always displayed 4.749V. Not anymore.

Thanks for reporting this. I suspect it may be a memory leak. We'll investigate!

 

@mozzwald was there a change in the voltage reporting code ? 

 

-Thom

 

Link to comment
Share on other sites

We've found the reason why this is happening. There are only a limited number of VFS handles compiled into ESP-IDF by default (8), and some of them are used for internal filestores. We are trying to figure out how to solve the problem.

 

-Thom

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

8 minutes ago, Pmetzen said:

And another screenshot of the web interface of the Fujinet

Do you know which hardware version you actually have? Your webui screenshot reports v1.6.1 but perhaps that's wrong. I noticed in your log file you did a long press of button B for safe reset which leads me to believe you may have older hardware since you did not use the button C short press.

Link to comment
Share on other sites

Mozzwald Ich weiß, welche Hardware-Version ich habe. Die verkaufen mir keine gefälschten Fujinet-Module. Die B-Taste muss daher länger gedrückt werden, damit Fujinet einen Reset durchführen kann. Wenn ich die B-Taste nur kurz drücke, startet der Kassettenemulator. Siehe Standardprotokoll meiner Hardware

Fujinet-Web.txt

Link to comment
Share on other sites

1 hour ago, Pmetzen said:

Mozzwald I know what hardware version I have. They don't sell me fake Fujinet modules. The B button must therefore be pressed longer so that the Fujinet can perform a reset. If I press the B key only briefly, the cassette emulator starts. See Default Log of my hardware

Fujinet-Web.txt 1.52 kB · 0 downloads

So, which hardware version do you actually have?

Link to comment
Share on other sites

Mozzwald. Of course, I can also press the C key briefly on my Fujinet module. However, this leads to Fujinet only being restarted. I don't know if there will be a reset. This certainly works with the B button when you hold it down. A reset is also performed with the hardware version V1.6.1. Try for yourself and you'll see.

Link to comment
Share on other sites

1 hour ago, Pmetzen said:

Detected Hardware Version: 1.6.1 and up

I'm asking if you know the actual hardware version to determine if the hardware version detection code is broken or not. I made a small change to the detection code recently and it's quite possible something broke. Please confirm if you know for sure the actual hardware version is v1.6 (not the auto detected version that the firmware tells you).

 

1 hour ago, Pmetzen said:

I can also press the C key briefly on my Fujinet module. However, this leads to Fujinet only being restarted. I don't know if there will be a reset.

Button B Long Press and Button C Short Press on v1.3 and up hardware produce the same result, Safe Reset. If you continue to Hold Button B while FujiNet boots up it will wipe the configuration stored in the FujiNet internal memory. Maybe you are referring to the configuration reset and not a simple reset.

Link to comment
Share on other sites

1 hour ago, Pmetzen said:

chak909 There is no change in the voltage signal code? This is not visible in the protocol.

Here is the git blame, for that section of the code: https://github.com/FujiNetWIFI/fujinet-platformio/blob/master/lib/hardware/fnSystem.cpp#L308

image.thumb.png.76d4d0885640b205a5ec777e2fe744d8.png

As you can see, it has not been modified recently

 

What is ALSO apparent, the voltage is calculated differently depending on the hardware revision, which is why @mozzwald asked. He saw an explicit discrepancy:

int SystemManager::get_sio_voltage()
{
#if !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(PINMAP_A2_REV0)
    // Configure ADC1_CH7
    adc1_config_width(ADC_WIDTH_12Bit);
    adc1_config_channel_atten(ADC1_CHANNEL_7, ADC_ATTEN_11db);

    // Calculate ADC characteristics
    esp_adc_cal_characteristics_t adc_chars;
    esp_adc_cal_value_t val_type = esp_adc_cal_characterize(ADC_UNIT_1, ADC_ATTEN_DB_11, ADC_WIDTH_BIT_12, 1100, &adc_chars);

    if (val_type == ESP_ADC_CAL_VAL_EFUSE_VREF) {
        Debug_println("SIO VREF: eFuse Vref");
    } else if (val_type == ESP_ADC_CAL_VAL_EFUSE_TP) {
        Debug_println("SIO VREF: Two Point");
    } else {
        Debug_println("SIO VREF: Default");
    }

    int samples = 10;
    uint32_t avgV = 0;
    uint32_t vcc = 0;

    for (int i = 0; i < samples; i++)
    {
        esp_adc_cal_get_voltage(ADC_CHANNEL_7, &adc_chars, &vcc);
        avgV += vcc;
        //delayMicroseconds(5);
    }

    avgV /= samples;

    // SIOvoltage = Vadc*(R1+R2)/R2
    if (avgV < 501)
        return 0;
    else if ( get_hardware_ver() >= 3 )
        return (avgV * 3200 / 2000); // v1.6 and up (R1=1200, R2=2000)
    else
        return (avgV * 5900 / 3900); // (R1=2000, R2=3900)
#else
    return 0;
#endif
}

 

Finally, the check_hardware_version() function, which sets the hardware version: 

/*  Find the FujiNet hardware version by checking the
    Pull-Up resistors.
    Check for pullup on IO12 (v1.6 and up), Check for
    pullup on IO14 (v1.1 and up), else v1.0
*/
void SystemManager::check_hardware_ver()
{
    int upcheck, downcheck, fixupcheck, fixdowncheck, spifixupcheck, spifixdowncheck;

    fnSystem.set_pin_mode(PIN_CARD_DETECT_FIX, gpio_mode_t::GPIO_MODE_INPUT, SystemManager::pull_updown_t::PULL_DOWN);
    fixdowncheck = fnSystem.digital_read(PIN_CARD_DETECT_FIX);

    fnSystem.set_pin_mode(PIN_CARD_DETECT_FIX, gpio_mode_t::GPIO_MODE_INPUT, SystemManager::pull_updown_t::PULL_UP);
    fixupcheck = fnSystem.digital_read(PIN_CARD_DETECT_FIX);

    fnSystem.set_pin_mode(PIN_CARD_DETECT, gpio_mode_t::GPIO_MODE_INPUT, SystemManager::pull_updown_t::PULL_DOWN);
    downcheck = fnSystem.digital_read(PIN_CARD_DETECT);

    fnSystem.set_pin_mode(PIN_CARD_DETECT, gpio_mode_t::GPIO_MODE_INPUT, SystemManager::pull_updown_t::PULL_UP);
    upcheck = fnSystem.digital_read(PIN_CARD_DETECT);

#ifdef PINMAP_A2_REV0
    /* Apple 2 Rev00 original has no hardware pullup for Button C Safe Reset.
       Apple 2 Rev00 with SPI fix has 10K hardware pullup on IO14.
       Check for pullup and determine if safe reset button or SPI fix
    */
    fnSystem.set_pin_mode(PIN_BUTTON_C, gpio_mode_t::GPIO_MODE_INPUT, SystemManager::pull_updown_t::PULL_UP);
    spifixupcheck = fnSystem.digital_read(PIN_BUTTON_C);
    fnSystem.set_pin_mode(PIN_BUTTON_C, gpio_mode_t::GPIO_MODE_INPUT, SystemManager::pull_updown_t::PULL_DOWN);
    spifixdowncheck = fnSystem.digital_read(PIN_BUTTON_C);

    if(spifixdowncheck == spifixupcheck)
    {
        a2spifix = true;
#ifdef MASTERIES_SPI_FIX
        Debug_println("Masteries SPI fix ENABLED");
    #ifdef PIN_SD_HOST_MOSI
    #undef PIN_SD_HOST_MOSI
    #endif
    #define PIN_SD_HOST_MOSI GPIO_NUM_14
#else
        Debug_println("FujiApple SPI fix ENABLED");
#endif // MASTERIES_SPI_FIX
    }
    else
    {
        a2spifix = false;
        Debug_println("FujiApple SPI fix NOT DETECTED");
    }
#else
    fnSystem.set_pin_mode(PIN_BUTTON_C, gpio_mode_t::GPIO_MODE_INPUT, SystemManager::pull_updown_t::PULL_DOWN);
#endif

    if(fixupcheck == fixdowncheck)
    {
        // v1.6.1 fixed/changed card detect pin
        _hardware_version = 4;
        _pin_card_detect = PIN_CARD_DETECT_FIX;
        // Create a queue to handle card detect event from ISR
        card_detect_evt_queue = xQueueCreate(10, sizeof(uint32_t));
        // Start card detect task
        xTaskCreate(card_detect_intr_task, "card_detect_intr_task", 2048, NULL, 10, NULL);
        // Enable interrupt for card detection
        fnSystem.set_pin_mode(PIN_CARD_DETECT_FIX, gpio_mode_t::GPIO_MODE_INPUT, SystemManager::pull_updown_t::PULL_NONE, GPIO_INTR_ANYEDGE);
        // Add the card detect handler
        gpio_isr_handler_add((gpio_num_t)PIN_CARD_DETECT_FIX, card_detect_isr_handler, (void *)PIN_CARD_DETECT_FIX);
    }
    else if (upcheck == downcheck)
    {
        // v1.6
        _hardware_version = 3;
        _pin_card_detect = PIN_CARD_DETECT;
        // Create a queue to handle card detect event from ISR
        card_detect_evt_queue = xQueueCreate(10, sizeof(uint32_t));
        // Start card detect task
        xTaskCreate(card_detect_intr_task, "card_detect_intr_task", 2048, NULL, 10, NULL);
        // Enable interrupt for card detection
        fnSystem.set_pin_mode(PIN_CARD_DETECT, gpio_mode_t::GPIO_MODE_INPUT, SystemManager::pull_updown_t::PULL_NONE, GPIO_INTR_ANYEDGE);
        // Add the card detect handler
        gpio_isr_handler_add((gpio_num_t)PIN_CARD_DETECT, card_detect_isr_handler, (void *)PIN_CARD_DETECT);
    }
    else if (fnSystem.digital_read(PIN_BUTTON_C) == DIGI_HIGH)
    {
        // v1.1 thru v1.5
        _hardware_version = 2;
    }
    else
    {
        // v1.0
        _hardware_version = 1;
    }

    fnSystem.set_pin_mode(PIN_BUTTON_C, gpio_mode_t::GPIO_MODE_INPUT, SystemManager::pull_updown_t::PULL_NONE);
}

 

-Thom

 

  • Like 1
Link to comment
Share on other sites

I can't confirm if I really have hardware version 1.6. I opened the module and could not see anything in it which hardware version it is. I can only see that the module is from 2021-09-29. Got the module from the original dealer who sold it. There was Fujinet V1.6 in the ordering process. They don't sell me fake modules.

Link to comment
Share on other sites

7 minutes ago, Pmetzen said:

I can't confirm if I really have hardware version 1.6. I opened the module and could not see anything in it which hardware version it is. I can only see that the module is from 2021-09-29. Got the module from the original dealer who sold it. There was Fujinet V1.6 in the ordering process. They don't sell me fake modules.

That date means the board is indeed v1.6 which is being correctly identified by the firmware. Can you reinstall the previous working firmware you had on it and confirm if the SIO Voltage is correct or not? 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...