Bonjour à tous, j’espère que vous allez bien. Aujourd’hui présentation de la Breakout board que j’ai réalisé pour tester un module NRF52840 de chez HolyIOT
Pourquoi avoir dessiné cette carte? Tout simplement car le NRF52840 est en train de prendre une énorme place sur le marché des makers ou des entreprises et il est de bon ton de regarder et comprendre comment il fonctionne… Surtout qu’il intègre le Bluetooth 5.0 🥰
Datasheet : https://www.nordicsemi.com/DocLib
Bonne lecture, il y a pas loin de 620 pages et au moins 6 errata… 😰
Rien de bien difficile donc, à part la partie soudure qui demande un stencil afin de souder tous les pads du module. Néanmoins vu que j’ai routé les pads internes grâce à des vias, je pense qu’il est possible de tous souder grâce à un bon fer à souder. 😌
Il faut un programmeur de type J-link. Un ST-Link V2 doit pouvoir convenir mais personnellement j’utilise le J-Link des cartes DK de Nordic : https://devzone.nordicsemi.com/f/nordic-q-a/20536/programming-external-custom-nrf52832-board-using-nrf52-dk
Deux possibilités pour envoyer pour coder et envoyer le soft sur la carte :
- soit depuis l’Arduino IDE grâce au travail d’Adafruit : https://github.com/adafruit/Adafruit_nRF52_Arduino
- Soit grâce à Embedded Studio : https://www.segger.com/products/development-tools/embedded-studio/
Même si l’Arduino IDE restreint beaucoup de possibilités et de fonctionnalités, il permet d’avoir une résultat très rapidement… Afin de s’assurer que tout marche comme il faut…
- C2 : est un condensateur de découplage, un 100nF 25V convient parfaitement en 0805.
- J4 : est un connecteur type JTAG et permet de connecter une sonde directement si vous ne voulez pas utiliser J5.
Je sais ce que vous allez me dire pourquoi utiliser un module alors que la puce est moins chère à l’unité? Tout simplement car le format AQFN de la puce fabriqué par Nordic est tout simplement nul. Hein pourquoi faire simple quand on peut faire compliqué 🥴 :
Source : https://www.nordicsemi.com/DocLib
Franchement à 5,66€ le module je n’allais pas passer 25h à faire une footprint et comme nos amis sont Chinois sont très fort autant travailler avec eux plutôt que contre eux. (Donald si tu nous écoutes… 😁)
J’ai acheté les modules sur Aliexpress : https://fr.aliexpress.com/item/Nordique-nRF52840-module-Bluetooth-grille-conseil-de-d-veloppement-BLE5-0-Bluetooth-s-rie-de-faible/32868365660.html
Les sources sont disponibles ici : https://github.com/Anderson69s/ADM_52840
Remerciement particulier à Arturo182 qui m’a passer un modèle 3D au format STEP pour le module : https://twitter.com/arturo182
@Bientôt Anders 😊
Bonjour,
Merci pour votre article, j’utilise une carte Holyiot-19048, similaire à votre design.
pourriez vous détailler les adaptations (logicielles ) à faire sur les fichiers de définition des cartes (Board.txt, variant.h et variant.cpp) pour pouvoir utiliser l’IDE arduino
ou toute autre info utilise ..;
Merci
Bonjour Noega33, j’espère que vous allez bien.
Je suis désolé pour ma réponse tardive.
Je suis en train de faire les définitions de ports. C’est un peu compliqué il faut passer pas mal de temps dans les datasheet et documentations afin d’avancer petit à petit.
Je prévois de partager directement sur github via le repo d’adafruit mon travail. Ce qui devrait vous permettre d’utiliser votre carte sur micropython ou Arduino IDE vu que on utilises le même module 😉
@Bientôt Anders
@Anderson69s
Bonjour,
Merci pour la réponse, en fait, depuis notre dernier échange, après avoir passé pas mal de temps pour savoir si j’allais utiliser l’IDE Arduino ou développer avec Eclipse, je suis revenu vers… Arduino!
J’ai enfin compris comment fonctionnaient les variant.h et variant.cpp et d’ici fin de semaine mon application devrait rouler…. 🙂
si cela marche, je communiquerai
A+, noega33
Bonjour Gus, j’espère que vous allez bien.
J’ai hâte de voir le résultat de vos avancées, j’ai recommencé à mettre les mains dans le code également 😉
@Bientôt donc 🙂
Anders
Bonjour Anders,
J’ai crée les variants (cpp et h) pour le Holyiot, je l’ai configuré pour 2 bus I2C, 3 LED, un bouton et une liaison série RX/TX
Je communique avec la carte par le BUS USB
Voici les fichiers variant.cpp, Variant.h, boards.txt et le mapping de la carte
variant.cpp:
/*
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
Copyright (c) 2016 Sandeep Mistry All right reserved.
Copyright (c) 2018, Adafruit Industries (adafruit.com)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include « variant.h »
#include « wiring_constants.h »
#include « wiring_digital.h »
#include « nrf.h »
const uint32_t g_ADigitalPinMap[] =
{
// P0
0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ,
8 , 9 , 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31,
// P1
32, // P1.00
33, // P1.01
34, // P1.02
35, // P1.03
36, // P1.04
37, // P1.05
38, // P1.06
39, // P1.07
40, // P1.08
41, // P1.09
42, // P1.10
43, // P1.11
44, // P1.12
45, // P1.13
46, // P1.14
47 // P1.15
};
void initVariant()
{
// LED1 & LED2
pinMode(PIN_LED1, OUTPUT);
ledOff(PIN_LED1);
pinMode(PIN_LED2, OUTPUT);
ledOff(PIN_LED2);
pinMode(PIN_LED3, OUTPUT);
ledOff(PIN_LED3);
}
variant.h:
/*
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
Copyright (c) 2016 Sandeep Mistry All right reserved.
Copyright (c) 2018, Adafruit Industries (adafruit.com)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _VARIANT_PCA10056_
#define _VARIANT_PCA10056_
/** Master clock frequency */
#define VARIANT_MCK (64000000ul)
#define USE_LFXO // Board uses 32khz crystal for LF
// define USE_LFRC // Board uses RC for LF
/*—————————————————————————-
* Headers
*—————————————————————————-*/
#include « WVariant.h »
#ifdef __cplusplus
extern « C »
{
#endif // __cplusplus
// Number of pins defined in PinDescription array
#define PINS_COUNT (48)
#define NUM_DIGITAL_PINS (48)
#define NUM_ANALOG_INPUTS (8)
#define NUM_ANALOG_OUTPUTS (0)
// LEDs
#define PIN_LED1 (22)
#define PIN_LED2 (5)
#define PIN_LED2 (4)
#define LED_STATE_ON 0 // State when LED is litted
/*
* Buttons
*/
#define PIN_BUTTON1 (31)
/*
* Analog pins
*/
#define PIN_A0 (2)
#define PIN_A1 (3)
#define PIN_A2 (4)
#define PIN_A3 (5)
#define PIN_A4 (28)
#define PIN_A5 (29)
#define PIN_A6 (30)
#define PIN_A7 (31)
static const uint8_t A0 = PIN_A0 ;
static const uint8_t A1 = PIN_A1 ;
static const uint8_t A2 = PIN_A2 ;
static const uint8_t A3 = PIN_A3 ;
static const uint8_t A4 = PIN_A4 ;
static const uint8_t A5 = PIN_A5 ;
static const uint8_t A6 = PIN_A6 ;
static const uint8_t A7 = PIN_A7 ;
#define ADC_RESOLUTION 14
// Other pins
#define PIN_AREF (2)
#define PIN_NFC1 (9)
#define PIN_NFC2 (10)
static const uint8_t AREF = PIN_AREF;
/*
* Serial interfaces
*/
// UART
#define PIN_SERIAL_RX (30) // P0.30
#define PIN_SERIAL_TX (29) // P0.29
// Connected to Jlink CDC
#define PIN_SERIAL2_RX (8)
#define PIN_SERIAL2_TX (6)
/*
* SPI Interfaces
*/
#define SPI_INTERFACES_COUNT 1
#define PIN_SPI_MISO (46)
#define PIN_SPI_MOSI (45)
#define PIN_SPI_SCK (47)
static const uint8_t SS = 44 ;
static const uint8_t MOSI = PIN_SPI_MOSI ;
static const uint8_t MISO = PIN_SPI_MISO ;
static const uint8_t SCK = PIN_SPI_SCK ;
/*
* Wire Interfaces
*/
#define WIRE_INTERFACES_COUNT 2
#define PIN_WIRE_SDA (35)
#define PIN_WIRE_SCL (32)
#define PIN_WIRE1_SDA (38)
#define PIN_WIRE1_SCL (36)
// QSPI Pins
#define PIN_QSPI_SCK 19
#define PIN_QSPI_CS 17
#define PIN_QSPI_IO0 20
#define PIN_QSPI_IO1 21
#define PIN_QSPI_IO2 22
#define PIN_QSPI_IO3 23
// On-board QSPI Flash
#define EXTERNAL_FLASH_DEVICES MX25R6435F
#define EXTERNAL_FLASH_USE_QSPI
#ifdef __cplusplus
}
#endif
/*—————————————————————————-
* Arduino objects – C++ only
*—————————————————————————-*/
#endif
Rajouter texte suivant dans boards.txt
# ———————————-
# Holyiot_18010
# ———————————-
Holyiot_18010.name=Holyiot_18010
Holyiot_18010.bootloader.tool=bootburn
# Upload
Holyiot_18010.upload.tool=nrfutil
Holyiot_18010.upload.protocol=nrfutil
Holyiot_18010.upload.use_1200bps_touch=true
Holyiot_18010.upload.wait_for_upload_port=true
Holyiot_18010.upload.maximum_size=815104
Holyiot_18010.upload.maximum_data_size=237568
# Build
Holyiot_18010.build.mcu=cortex-m4
Holyiot_18010.build.f_cpu=64000000
Holyiot_18010.build.board=HOLYIOT_18010
Holyiot_18010.build.core=nRF5
Holyiot_18010.build.variant=Holyiot_18010
Holyiot_18010.build.usb_manufacturer= »Holyiot »
Holyiot_18010.build.usb_product= »Holyiot_18010″
Holyiot_18010.build.extra_flags=-DNRF52840_XXAA {build.flags.usb}
Holyiot_18010.build.ldscript=nrf52840_s140_v6.ld
Holyiot_18010.build.vid=0x239A
Holyiot_18010.build.pid=0x8029
# SofDevice Menu
Holyiot_18010.menu.softdevice.s140v6=0.3.2 SoftDevice s140 6.1.1
Holyiot_18010.menu.softdevice.s140v6.build.sd_name=s140
Holyiot_18010.menu.softdevice.s140v6.build.sd_version=6.1.1
Holyiot_18010.menu.softdevice.s140v6.build.sd_fwid=0x00B6
# Debug Menu
Holyiot_18010.menu.debug.l0=Level 0 (Release)
Holyiot_18010.menu.debug.l0.build.debug_flags=-DCFG_DEBUG=0
Holyiot_18010.menu.debug.l1=Level 1 (Error Message)
Holyiot_18010.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1
Holyiot_18010.menu.debug.l2=Level 2 (Full Debug)
Holyiot_18010.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
Holyiot_18010.menu.debug.l3=Level 3 (Segger SystemView)
Holyiot_18010.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
Holyiot_18010.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
La carte apparaitra sous le nom: Holyiot_18010 dans le menu des cartes dispo
Voici le mapping de la carte:
La premiere collonne est le numéro de PIN de la carte
La deuxiemme colonne est le numero d’ordre dana la matrice g_ADigitalPinMap[] du fichier variant.cpp
PIN# g_ADigitalPinMap[] Function
46 D- Digital I/O
45 D+ Digital I/O
1 GND Ground
32 GND Ground
44 GND Ground
7 2 P0.02 Digital I/O Analog input
6 3 P0.03 Digital I/O Analog input
12 4 P0.04 Digital I/O Analog input PIN_LED3
13 5 P0.05 Digital I/O Analog input PIN_LED2
21 6 P0.06 Digital I/O
54 7 P0.07 Digital I/O
20 8 P0.08 Digital I/O
34 9 P0.09 Digital I/O NFC input
33 10 P0.10 Digital I/O NFC input
17 11 P0.11 Digital I/O
52 12 P0.12 Digital I/O Trace data
30 13 P0.13 Digital I/O
29 14 P0.14 Digital I/O
28 15 P0.15 Digital I/O
31 16 P0.16 Digital I/O
27 17 P0.17 Digital I/O
48 18 P0.18 Digital I/O
49 19 P0.19 Digital I/O
26 20 P0.20 Digital I/O
50 21 P0.21 Digital I/O
43 22 P0.22 Digital I/O PIN_LED1
51 23 P0.23 Digital I/O
25 24 P0.24 Digital I/O
16 25 P0.25 Digital I/O
22 26 P0.26 Digital I/O
19 27 P0.27 Digital I/O
8 28 P0.28 Digital I/O Analog input
9 29 P0.29 Digital I/O Analog input PIN_SERIAL_TX
10 30 P0.30 Digital I/O Analog input PIN_SERIAL_RX
11 31 P0.31 Digital I/O Analog input PIN_BUTTON1
42 32 P1.00 Digital I/O PIN_WIRE_SCL
40 33 P1.01 Digital I/O
39 34 P1.02 Digital I/O
41 35 P1.03 Digital I/O PIN_WIRE_SDA
36 36 P1.04 Digital I/O PIN_WIRE1_SCL
24 37 P1.05 Digital I/O
35 38 P1.06 Digital I/O PIN_WIRE1_SDA
23 39 P1.07 Digital I/O
18 40 P1.08 Digital I/O
53 41 P1.09 Digital I/O Trace data
2 42 P1.10 Digital I/O
3 43 P1.11 Digital I/O Trace data
15 44 P1.12 Digital I/O
4 45 P1.13 Digital I/O
14 46 P1.14 Digital I/O
5 47 P1.15 Digital I/O
38 SWDCLK SWD for debug and programming
37 SWDIO SWD for debug and programming
55 V_nRF(VDD/VDDH) VDD/VDDH
47 VBUS Power
en espérant que c’est compréhensible.
J’ai testé le tout avec des liasons BL et port série et cela fonctionne
cordialement
Gus
Bonsoir noega33, j’espère que vous allez bien.
Si je ne dis pas de bêtises, vous avez modifié les fichiers de bases de définition fournit par Sandeep et Adafruit pour l’Arduino IDE?
Je suis descendu un peu plus profond et j’ai d’abord compilé un bootloader pour le Hoyliot ce qui permet d’utiliser l’Arduino IDE ou CircuitPython.
Il faut maintenant que je fasse la même chose que vous pour ma carte ^^
@Bientôt
J’ai installé:
pca10056_bootloader-0.3.0_s140_6.1.1.hex
avec nrf Connect et J-link
et en effet j’avais modifié les fichiers PCA10056, varinat.cpp et variant.h
bonne soirée
Gus
Nickel j’ai commencé ainsi aussi 🙂
Je vous tiens au courant quand j’ai plus avancés 😉
@Bientôt
Hey Anderson, I’m also working on same HOLYIOT nrf52840 module. I have used Sandeep Mistry’s NRF library and I tried few basic examples and BLE examples from BLE peripheral .but the generic variant has very few pins defined in « variant.h » so could you please share what changes do i have make in Sandeep’s library files to use it with HOLYIOT nrf52840 module .I’m using Arduino IDE & STLINk v2 to program it. It would be really helpful to me if you share the files .Thanks in advance
Hi Smark1, I hope you have a great day.
I’m sorry for my late answer… Actually I don’t have make any progress on this module because, I remade the carry board for the module…
I don’t know if there is progress on the support for this module on Arduino IDE.
Best regards, Anders
Hi, I was looking what chip to use for my friendly home-soldering project and I encountered this module, I’m interested to know how hard was to solder the pads in the back of the module to your board and if you tried to desolder it with a conventional method like a heat gun or a soldering iron.
Hi Axel, I hope you have a great day.
Actually, if you place vias on the PCB under the pad you can hand solder the module. Like I made on my PCB. Using a stencil and a heat gun, it’s very easy to solder this module on a PCB.
To desolder it, I cheated, I used low temperature iron to solder the module on the PCB, as the nRF and the other components have been sold using high temperature iron, it very easy and safe to desolder the module with my cheat… 😉
Best regards,
@ Anderson69s
I hope that everything is fine on your end.
I reminber you said that you have compilied a Bootloader.
Does, by any chance, this bootloader have DFU OTA buttonless capability ?
I’ve been fighting for two days to recompile the Adafruit bootloader but for whatever reason my Make keeps crashing.
Would you mind sharing your method for recompiling (or your bootloader)?
Thank in advance
Noega33
Hi Gus, I hope you have a good day.
I’m sorry for my late answer. I’m using USB câble to flash the bootloader so I can’t help you with the DFU OTA buttonless capability. I didn’t know that it was doable.
Did you mak a recurvise command when you clone the adafruit repository? I know I struggled on this more than one time.
Best Regards, Anders