Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

wizchip_reset() does not fully configure GPIO #4

Open
AmeNote-Michael opened this issue Dec 21, 2022 · 0 comments
Open

wizchip_reset() does not fully configure GPIO #4

AmeNote-Michael opened this issue Dec 21, 2022 · 0 comments

Comments

@AmeNote-Michael
Copy link

AmeNote-Michael commented Dec 21, 2022

The routine wizchip_reset() in w5x00_spi.c does not properly configure the GPIO used to reset the wisnet chip leaving it to randomly work. Need to make sure to perform a gpio_init(PIN_RST) before setting direction and using. Below is example code of how I fixed this issue.

void wizchip_reset()
{
    static bool isConfigured = false;

    if ( !isConfigured )
    {
        gpio_init(PIN_RST);     // Initialize as a GPIO
        gpio_set_dir(PIN_RST, GPIO_OUT);    // Configure as an output
        isConfigured = true;
    }

    gpio_put(PIN_RST, 0);
    sleep_ms(100);

    gpio_put(PIN_RST, 1);
    sleep_ms(100);

    bi_decl(bi_1pin_with_name(PIN_RST, "W5x00 RESET"));
}
@AmeNote-Michael AmeNote-Michael changed the title wishcip wizchip_reset() does not fully configure GPIO Dec 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant