khoih-prog / WiFiNINA_Generic

Enables WiFiNINA network connection (local and Internet) for SAM DUE, SAMD21, SAMD51, Teensy, AVR Mega, STM32, RP2040-based boards, etc. in addition to Arduino MKR WiFi 1010, Arduino MKR VIDOR 4000, Arduino UNO WiFi Rev.2 , Nano 33 IoT, Nano_RP2040_Connect. Now with fix of severe limitation to permit sending much larger data than total 4K
GNU General Public License v3.0
38 stars 13 forks source link

Pinout for STM32F1 "blue pill" #6

Closed Selective031 closed 4 years ago

Selective031 commented 4 years ago

Hi,

I have an issue with communicating with my "Adafruit atwinc1500 breakout board". Its connected to a Blue Pill (STM32F103C8T6), using Arduino IDE 1.8.3 and Arduino Core 1.9.0 Pins: MISO,MOSI,SCK (PA7,PA6,PA5) PA4 - CS PA3 - IRQ PA2 - Reset But I cannot communicate with the board. I´m a little puzzled with the pinout found in the "Wifinina_pinout_generic.h" file.

Any help is very appreciated!

UPDATE, I can load the official WiFi101 library and I´m able to print out the firmware version using one of the examples, but I cannot run anything else. This would at least tell me the wiring is correct. But running the same "CheckFirmwareVersion" in WiFiNINA Generic does not work.

khoih-prog commented 4 years ago

@tcpipchip

Can you offer some help here as I don't have the STM32F103C8T6.

tcpipchip commented 4 years ago

hi @Selective031

Here was my connection using my MCU with W102 (WIFININA)

See in right size the PINOUT of WIFININA

image

Selective031 commented 4 years ago

Hi @tcpipchip

I´m using this schematic, image

How would I translate this in wifinina_pinout_generic.h file ?

I tried to do it like this: image

But I get no response from the board.

tcpipchip commented 4 years ago

looks right! Its the WIFININA ALIVE ? Has the firmware inside ? Can you measure on Osciloscope if there is answer ?

Selective031 commented 4 years ago

If I load the official WIFI101 (https://www.arduino.cc/en/Reference/WiFi101) and use the "CheckWiFi101FirmwareVersion" and add "WiFi.setPins(PA4,PA3,PA2)" it will print out the firmware version, so it is working. However that library is not made for STM32 and will not work.

So my hope is WiFiNINA library ;)

khoih-prog commented 4 years ago

@tcpipchip and @Selective031

Just some info FYI. To use ATWINC1500 is a little bit tricky, and you have to experiment and explore yourself. It's difficult to help without the related hardware.

ATWINC1500 Wiring-and-Test

Selection_560

Selection_561

tcpipchip commented 4 years ago

sorry, i had seen that you was using STM32

Selective031 commented 4 years ago

@khoih-prog Exactly, so when running this:

image

it will give me a reply in serial monitor:

image

khoih-prog commented 4 years ago

@Selective031 @tcpipchip

I currently don't think ATWINC1500 is supported by WiFiNINA/WiFiNINA_Generic library because there is no code to drive the IRQ pin which is actively used in ATWINC1500/WiFi101 library. Certainly just a good guess as I have no hardware to check.

In WiFi101 lib:

1. In WiFi.cpp

void WiFiClass::setPins(int8_t cs, int8_t irq, int8_t rst, int8_t en)
{
  gi8Winc1501CsPin = cs;
  gi8Winc1501IntnPin = irq;
  gi8Winc1501ResetPin = rst;
  gi8Winc1501ChipEnPin = en;
}

2. In bsp/source/nm_bsp_arduino.c

int8_t gi8Winc1501CsPin = WINC1501_SPI_CS_PIN;
int8_t gi8Winc1501ResetPin = WINC1501_RESET_PIN;
int8_t gi8Winc1501IntnPin = WINC1501_INTN_PIN;
int8_t gi8Winc1501ChipEnPin = WINC1501_CHIP_EN_PIN;

...

void nm_bsp_register_isr(tpfNmBspIsr pfIsr)
{
    gpfIsr = pfIsr;
    attachInterruptMultiArch(gi8Winc1501IntnPin, chip_isr, FALLING);
}

...

void nm_bsp_interrupt_ctrl(uint8 u8Enable)
{
    if (u8Enable) {
        attachInterruptMultiArch(gi8Winc1501IntnPin, chip_isr, FALLING);
    } else {
        detachInterruptMultiArch(gi8Winc1501IntnPin);
    }
}

So it's better to use another shield for WiFiNINA library, such as Ublox W102, etc

tcpipchip commented 4 years ago

W102 i know that works very fine on STM32, because i already tested!

Selective031 commented 4 years ago

Ok guys, thanks for trying! You can close this.