W80x_Duino un nouveau processeur Arduino

Bonjour à tous,
Certains se demande comment faire fonctionner ce nouveau processeur avec l'IDE Arduino.
Voici un petit exemple pour vous mettre sur la voie.

Dans l'IDE ajouter dans les préférence le lien vers le SDK (fichier ".json")
dans URL de gestionnaire de cartes supplémentaires:
"https://cdn.jsdelivr.net/gh/Hi-LinkDuino/w80x_arduino/package_w80x_index.json"

Voici un code de test :

#include <stdio.h>
#include <Arduino.h>

static volatile uint8_t key_flag = -1;

static void GPIO_Init(void) {
  // Déclaration et initialisation des ports/pins GPIO utilisés
  GPIO_InitTypeDef GPIO_InitStruct = {0};
  GPIO_InitStruct.Pin = GPIO_PIN_5 | GPIO_PIN_25 | GPIO_PIN_26 | GPIO_PIN_18 | GPIO_PIN_17 | GPIO_PIN_16 | GPIO_PIN_11;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT;
  GPIO_InitStruct.Pull = GPIO_NOPULL;
  HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
  HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5 | GPIO_PIN_25 | GPIO_PIN_26 | GPIO_PIN_18 | GPIO_PIN_17 | GPIO_PIN_16 | GPIO_PIN_11, GPIO_PIN_SET);
}

void setup() {
  // mettre le code d'installation ici, à exécuter une fois :
  printf("Led Demo Blink\r\n");
  GPIO_Init();
}

void loop() {
  // mettre le code principal ici, à exécuter en boucle :
  HAL_Delay(200);
  key_flag++;
  
  if (key_flag == 0) {
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, (GPIO_PinState)0);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_25, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_26, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_18, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_17, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_16, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_11, (GPIO_PinState)1);
  } else if (key_flag == 1) {
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_25, (GPIO_PinState)0);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_26, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_18, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_17, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_16, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_11, (GPIO_PinState)1);
  } else if (key_flag == 2) {
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_25, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_26, (GPIO_PinState)0);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_18, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_17, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_16, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_11, (GPIO_PinState)1);
  } else if (key_flag == 3) {
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_25, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_26, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_18, (GPIO_PinState)0);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_17, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_16, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_11, (GPIO_PinState)1);
  } else if (key_flag == 4) {
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_25, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_26, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_18, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_17, (GPIO_PinState)0);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_16, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_11, (GPIO_PinState)1);
  } else if (key_flag == 5) {
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_25, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_26, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_18, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_17, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_16, (GPIO_PinState)0);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_11, (GPIO_PinState)1);
  } else if (key_flag == 6) {
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_25, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_26, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_18, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_17, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_16, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_11, (GPIO_PinState)0);
  } else if (key_flag == 7) {
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_25, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_26, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_18, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_17, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_16, (GPIO_PinState)0);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_11, (GPIO_PinState)1);
  } else if (key_flag == 8) {
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_25, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_26, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_18, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_17, (GPIO_PinState)0);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_16, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_11, (GPIO_PinState)1);
  } else if (key_flag == 9) {
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_25, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_26, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_18, (GPIO_PinState)0);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_17, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_16, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_11, (GPIO_PinState)1);
  } else if (key_flag == 10) {
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_25, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_26, (GPIO_PinState)0);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_18, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_17, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_16, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_11, (GPIO_PinState)1);
  } else if (key_flag == 11) {
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_25, (GPIO_PinState)0);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_26, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_18, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_17, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_16, (GPIO_PinState)1);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_11, (GPIO_PinState)1);
    key_flag = -1;
  }
}








/* END */

Salut.
Si je ne m'abuse, il s'agit de la même API que celle de ST Microelectronics (STM32).
Je vois ici que certaines API ARDUINO existent (pinMode, digitalWrite, etc.).

Bonjour,
c'est une blague ?
(j'ai déjà un gros carton plein de trucs à €1,05 dont il faudra que je fasse clignoter la led)

il existe un tas de constructeurs chinois qui ont fait des séries reprenant plusieurs principes du STM32 :

  • dénomination commerciale (pas le cas ici)
  • architecture
  • SDK (notamment le HAL_)
  • ...

(pourquoi refaire ce qui existe)
donc oui, ça se programme sensiblement pareil, y compris pour les références arduino
mais le hardware n'est pas complètement identique, et tous les portages ne seront peut-être jamais réalisés ... mais l'important, c'est que dans ces cas on puisse toujours s'en sortir en utilisant directement les instructions HAL_

Bon courage ... j'ai déjà pratiqué.

hbachetti => Je pense que cela ne concerne que le W0806 et pas le 801, mais c'est bon à savoir.

Pour ce qui est du reste, je ne fais aucune recommandation, j'ai posté cela parce qu'avec peu d'argent, on peut s'amuser, perso j'utilise plutôt l'ESP32 et j'ai récemment mis sur Github un exemple (pas mis à jour sur Github) GitHub - JLNapo/BorneGEMI: Créer une enceinte connectée pour votre domotique est possible à moindre frais..
Je ne dépend plus de Goo... ou Amaz... pour mes commandes domotique.

Ma remarque allait dans le sens suivant : il ne faudrait pas que des débutants pensent acheter ces cartes (peu chères et performantes, c'est vrai) en espérant pouvoir développer leurs applications de manière simple, comme on le fait avec les fonctions ARDUINO classiques, qui existent pour différents processeurs : AVR, ESP8266, ESP32, STM32, SAMD, etc.

De ce que je vois ici, pour le moment, les fonctions ARDUINO sont peu nombreuses. Il manque par exemple I2C et SPI.
L'implémentation SPI est incomplète :
https://github.com/Hi-LinkDuino/w80x_arduino/blob/main/libraries/SPI/src/SPI.cpp
Quant à l'implémentation I2C elle est carrément absente.

La conséquence directe est que l'on ne peut utiliser aucune des librairies que nous utilisons tous les jours.

Pour illustrer mon propos, voici un code gérant un LM75 I2C, écrit à l'aide de HAL :
https://vizigabor.eu/embedded/HomeAut/Source/Src/temperature.c
On est loin de la simplicité ARDUINO !

Mais il se peut que cela évolue, et que l'on dispose à l'avenir d'un core ARDUINO comme celui de STM32Duino.

Le message est clair : amateurs qui ne savez pas utiliser l'API HAL de STMicroelectronics, abstenez vous d'acheter ces cartes qui resteront forcément dans un tiroir.

hbachetti => Je suis complètement d'accord avec toi, ce processeur est trop jeune pour une exploitation correct, mais si (comme je l'ai fais) quelqu'un veut tester (ou s'amuser) avec ce circuit, il peut le faire simplement.
Il n'est pas question de l'utiliser comme un autre circuit compatible Arduino, mon exemple est juste didactique.
Pour le reste tes remarques sont très pertinentes et concises, HAL n'est pas facile pour tout le monde.

Ces cartes W806 et W801 me paraissent surdimensionnées pour l'usage courant ARDUINO :

  • 240MHz
  • 1 mo Flash et 288KB RAM

Très performantes et bon marché (le prix d'une NANO), mais pour quelles applications ?
Comme tu dis, l'ESP32 reste le joujou incontournable, et a l'avantage de bénéficier d'un core ARDUINO éprouvé, ce qui n'est pas le cas du W80X ... pour l'instant.

S'amuser avec HAL n'est pas le mot que j'emploierais, souffrir me paraît plus adapté, surtout lorsqu'il s'agit de SPI ou I2C.
A réserver aux initiés !

au début, il n'y avait rien d'autre que la librairie standard ST, il a bien fallu s'y mettre
puis le HAL_ est venu, en effet à la grande joie des masos

Il y avait aussi (cela a peut-être évolué) l'absence totale de librairie côté MSP430, et l'on devait se retrousser les manches pour écrire des drivers. Je pense en particulier à l'I2C sur lequel j'en ai sérieusement bavé. J'en connais d'autres qui ont baissé les bras et ont écrit un I2C logiciel.

Quand tu es obligé de te farcir l'écriture du moindre driver série, c'est toujours rebutant, le core ARDUINO a au moins l'avantage de réduire les efforts.

Avec HAL ce n'est pas beaucoup mieux, et je déconseille aux débutants.

I apologize to the moderator for English.

For controllers on the W80x core, there is a more advanced arduino package with support of i2c, SPI, timers, HardwareSerial etc...

you are welcome , b707
thanks for sharing !
AIR103 is a very nice board , but I personally (and I am probably not the only one) prefer the AIR32F103 , because it has more peripherals and this peripherals are more capable ; and it is compatible with a well known chip

I agree that stm32 has more interesting peripherals, but in this case I was interested in the task of creating a custom arduino addon for an unknown controller.

Potentially, this package can then be extended to the w801 variant, which has more extended features, for example includes Wi-Fi and BT.

Hallo. Is it possible to use liquidcrystal library with board W806? I've been battling this for days and can't get over it. I mean connecting LCD 2x16 (not I2C). Is it possible with the Arduino IDE?

I took a quick look at the source code of the LiquidCrystal library and as far as I can see, there are no low-level commands depending on the type of processor. Accordingly, I think that you can try to run this library on the W806 board.
Unfortunately, I do not have such a display to test on hardware. Can you try?

Bonsoir @tatoswinka et @b707

Par respect pour les utilisateurs de ce forum , utilisez la langue française pour vos interventions ou ouvrez un nouveau fil de discussion sur un forum anglophone pour poursuivre votre diaogue en anglais sur ce sujet

Merci

C'est mon code:

LiquidCrystal lcd(PB5, PB6, PB7, PB8, PB9, PB12);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis() / 1000);
}

Il y a une erreur lors de la compilation:

In file included from C:\Users\Robcio\AppData\Local\Temp\.arduinoIDE-unsaved202371-4072-u7yovo.zpxzp\HelloWorld\HelloWorld.ino:44:0:
C:\Users\Robcio\AppData\Local\Arduino15\libraries\LiquidCrystal\src/LiquidCrystal.h:4:22: fatal error: inttypes.h: No such file or directory
 #include <inttypes.h>
                      ^
compilation terminated.

exit status 1

Compilation error: exit status 1

pour d'autres cartes comme Atmega, Pico ou STM32duino tout est ok.

commentez cette ligne dans le fichier LiquidCrystal.h et la même dans le fichier LiquidCrystal.cpp

Désolé, je ne parle pas du tout français.
Pouvez-vous créer un sujet avec cette question dans la partie principale du forum ?