Skip to content
This repository was archived by the owner on Jan 18, 2023. It is now read-only.

Commit 2d13d7c

Browse files
authored
v1.1.0 to fix multiple-definitions linker error
### Releases v1.1.0 1. Fix `multiple-definitions` linker error. Check [Different behaviour using the src_cpp or src_h lib #80](khoih-prog/ESPAsync_WiFiManager#80) 2. Update all examples
1 parent 25f6f6d commit 2d13d7c

File tree

9 files changed

+211
-72
lines changed

9 files changed

+211
-72
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
1414

1515
Please ensure to specify the following:
1616

17-
* Arduino IDE version (e.g. 1.8.15) or Platform.io version
18-
* `Arduino mbed_nano` Core Version (e.g. Arduino mbed_nano core v2.4.1)
17+
* Arduino IDE version (e.g. 1.8.19) or Platform.io version
18+
* `Arduino mbed_nano` Core Version (e.g. Arduino mbed_nano core v2.6.1)
1919
* `nRF52840-based Nano_33_BLE` Board type (e.g. Nano_33_BLE, Nano_33_BLE_Sense, etc.)
2020
* Contextual information (e.g. what you were trying to achieve)
2121
* Simplest possible steps to reproduce
@@ -27,11 +27,11 @@ Please ensure to specify the following:
2727
### Example
2828

2929
```
30-
Arduino IDE version: 1.8.15
31-
Arduino mbed_nano core v2.4.1
30+
Arduino IDE version: 1.8.19
31+
Arduino mbed_nano core v2.6.1
3232
Nano_33_BLE board
3333
OS: Ubuntu 20.04 LTS
34-
Linux xy-Inspiron-3593 5.4.0-81-generic #91-Ubuntu SMP Thu Jul 15 19:09:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
34+
Linux xy-Inspiron-3593 5.4.0-91-generic #102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
3535
3636
Context:
3737
I encountered a crash while using TimerInterrupt.

README.md

Lines changed: 20 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@
1414
* [Why do we need this FS_Nano33BLE library](#why-do-we-need-this-FS_Nano33BLE-library)
1515
* [Features](#features)
1616
* [Currently supported Boards](#currently-supported-boards)
17-
* [Changelog](#changelog)
18-
* [Initial Releases v1.0.0](#initial-releases-v100)
17+
* [Changelog](changelog.md)
1918
* [Prerequisites](#prerequisites)
2019
* [Installation](#installation)
2120
* [Use Arduino Library Manager](#use-arduino-library-manager)
2221
* [Manual Install](#manual-install)
2322
* [VS Code & PlatformIO](#vs-code--platformio)
24-
* [HOWTO Fix `Multiple Definitions` Linker Error](#howto-fix-multiple-definitions-linker-error)
2523
* [Examples](#examples)
2624
* [ 1. FS_Counting](examples/FS_Counting)
2725
* [ 2. FS_Test](examples/FS_Test)
@@ -32,7 +30,6 @@
3230
* [3. FS_Test on Nano 33 BLE with FATFS size 256KB](#3-fs_test-on-nano-33-ble-with-fatfs-size-256kb)
3331
* [Debug](#debug)
3432
* [Troubleshooting](#troubleshooting)
35-
* [Releases](#releases)
3633
* [Issues](#issues)
3734
* [TO DO](#to-do)
3835
* [DONE](#done)
@@ -58,23 +55,13 @@ The filesystem access uses normal [POSIX APIs](https://www.tutorialspoint.com/c_
5855

5956
1. **MBED nRF52840-based boards such as Nano_33_BLE, Nano_33_BLE_Sense**, etc. using [**Arduino-mbed mbed_nano** core](https://github.com/arduino/ArduinoCore-mbed)
6057

61-
---
62-
---
63-
64-
## Changelog
65-
66-
### Initial Releases v1.0.0
67-
68-
1. Initial coding to support MBED nRF52840-based boards such as **Nano_33_BLE, Nano_33_BLE_Sense**, etc. using [**Arduino-mbed mbed_nano** core](https://github.com/arduino/ArduinoCore-mbed)
69-
70-
7158
---
7259
---
7360

7461
## Prerequisites
7562

76-
1. [`Arduino IDE 1.8.15+` for Arduino](https://www.arduino.cc/en/Main/Software)
77-
2. [`Arduino mbed_nano core 2.4.1+`](https://github.com/arduino/ArduinoCore-mbed) for Arduino (Use Arduino Board Manager) MBED nRF52840-based boards such as **Nano_33_BLE, Nano_33_BLE_Sense**. [![GitHub release](https://img.shields.io/github/release/arduino/ArduinoCore-mbed.svg)](https://github.com/arduino/ArduinoCore-mbed/releases/latest)
63+
1. [`Arduino IDE 1.8.19+` for Arduino](https://www.arduino.cc/en/Main/Software)
64+
2. [`Arduino mbed_nano core 2.6.1+`](https://github.com/arduino/ArduinoCore-mbed) for Arduino (Use Arduino Board Manager) MBED nRF52840-based boards such as **Nano_33_BLE, Nano_33_BLE_Sense**. [![GitHub release](https://img.shields.io/github/release/arduino/ArduinoCore-mbed.svg)](https://github.com/arduino/ArduinoCore-mbed/releases/latest)
7865

7966
---
8067
---
@@ -107,31 +94,6 @@ Another way to install is to:
10794
---
10895

10996

110-
### HOWTO Fix `Multiple Definitions` Linker Error
111-
112-
The current library implementation, using **xyz-Impl.h instead of standard xyz.cpp**, possibly creates certain `Multiple Definitions` Linker error in certain use cases. Although it's simple to just modify several lines of code, either in the library or in the application, the library is adding 2 more source directories
113-
114-
1. **scr_h** for new h-only files
115-
2. **src_cpp** for standard h/cpp files
116-
117-
besides the standard **src** directory.
118-
119-
To use the **old standard cpp** way, locate this library' directory, then just
120-
121-
1. **Delete the all the files in src directory.**
122-
2. **Copy all the files in src_cpp directory into src.**
123-
3. Close then reopen the application code in Arduino IDE, etc. to recompile from scratch.
124-
125-
To re-use the **new h-only** way, just
126-
127-
1. **Delete the all the files in src directory.**
128-
2. **Copy the files in src_h directory into src.**
129-
3. Close then reopen the application code in Arduino IDE, etc. to recompile from scratch.
130-
131-
---
132-
---
133-
134-
13597
### Examples
13698

13799
1. [FS_Counting](examples/FS_Counting)
@@ -143,6 +105,9 @@ To re-use the **new h-only** way, just
143105
### Example [FS_Test](examples/FS_Test)
144106

145107
```
108+
#define FS_NANO33BLE_VERSION_MIN_TARGET "FS_Nano33BLE v1.1.0"
109+
#define FS_NANO33BLE_VERSION_MIN 1001000
110+
146111
#define _FS_LOGLEVEL_ 1
147112
#define NANO33BLE_FS_SIZE_KB 256
148113
@@ -418,6 +383,14 @@ void setup()
418383
Serial.print("\nStart FS_Test on "); Serial.println(BOARD_NAME);
419384
Serial.println(FS_NANO33BLE_VERSION);
420385
386+
#if defined(FS_NANO33BLE_VERSION_MIN)
387+
if (FS_NANO33BLE_VERSION_INT < FS_NANO33BLE_VERSION_MIN)
388+
{
389+
Serial.print("Warning. Must use this example on Version equal or later than : ");
390+
Serial.println(FS_NANO33BLE_VERSION_MIN_TARGET);
391+
}
392+
#endif
393+
421394
myFS = new FileSystem_MBED();
422395
423396
if (!myFS->init())
@@ -480,23 +453,23 @@ The following is the sample terminal output when running example [FS_Counting](e
480453

481454
```
482455
Start FS_Test on Nano 33 BLE
483-
LittleFS_Nano33BLE v1.0.0
456+
LittleFS_Nano33BLE v1.1.0
484457
[LFS] LittleFS size (KB) = 256
485458
[LFS] LittleFS Mount OK
486459
Deleting file: /littlefs/counts.txt => OK
487460
Times have been run = 1
488461
=> Open to write OK
489462
490463
Start FS_Test on Nano 33 BLE
491-
LittleFS_Nano33BLE v1.0.0
464+
LittleFS_Nano33BLE v1.1.0
492465
[LFS] LittleFS size (KB) = 256
493466
[LFS] LittleFS Mount OK
494467
=> Open to read OK
495468
Times have been run = 2
496469
=> Open to write OK
497470
498471
Start FS_Test on Nano 33 BLE
499-
LittleFS_Nano33BLE v1.0.0
472+
LittleFS_Nano33BLE v1.1.0
500473
[LFS] LittleFS size (KB) = 256
501474
[LFS] LittleFS Mount OK
502475
=> Open to read OK
@@ -513,7 +486,7 @@ The following is the sample terminal output when running example [FS_Test](examp
513486

514487
```
515488
Start FS_Test on Nano 33 BLE
516-
LittleFS_Nano33BLE v1.0.0
489+
LittleFS_Nano33BLE v1.1.0
517490
[LFS] LittleFS size (KB) = 256
518491
[LFS] LittleFS Mount Fail
519492
[LFS] Formatting...
@@ -579,7 +552,7 @@ The following is the sample terminal output when running example [FS_Test](examp
579552

580553
```
581554
Start FS_Test on Nano 33 BLE
582-
FATFS_Nano33BLE v1.0.0
555+
FATFS_Nano33BLE v1.1.0
583556
[LFS] FATFS size (KB) = 256
584557
[LFS] FATFS Mount OK
585558
====================================================
@@ -661,14 +634,6 @@ Sometimes, the library will only work if you update the board core to the latest
661634
---
662635
---
663636

664-
## Releases
665-
666-
### Initial Releases v1.0.0
667-
668-
1. Initial coding to support MBED nRF52840-based boards such as **Nano_33_BLE, Nano_33_BLE_Sense**, etc. using [**Arduino-mbed mbed_nano** core](https://github.com/arduino/ArduinoCore-mbed)
669-
670-
---
671-
---
672637

673638
### Issues
674639

@@ -688,6 +653,7 @@ Submit issues to: [FS_Nano33BLE issues](https://github.com/khoih-prog/FS_Nano33B
688653
1. Basic LittleFS wrapper for MBED nRF52840-based boards such as **Nano_33_BLE, Nano_33_BLE_Sense**, using [**Arduino-mbed mbed_nano** core](https://github.com/arduino/ArduinoCore-mbed)
689654
2. Add Version String
690655
3. Add Table of Contents
656+
4. Fix `multiple-definitions` linker error
691657

692658
---
693659
---

changelog.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# FS_Nano33BLE Library
2+
3+
[![arduino-library-badge](https://www.ardu-badge.com/badge/FS_Nano33BLE.svg?)](https://www.ardu-badge.com/FS_Nano33BLE)
4+
[![GitHub release](https://img.shields.io/github/release/khoih-prog/FS_Nano33BLE.svg)](https://github.com/khoih-prog/FS_Nano33BLE/releases)
5+
[![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/khoih-prog/FS_Nano33BLE/blob/main/LICENSE)
6+
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing)
7+
[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/FS_Nano33BLE.svg)](http://github.com/khoih-prog/FS_Nano33BLE/issues)
8+
9+
---
10+
---
11+
12+
## Table of Contents
13+
14+
* [Changelog](#changelog)
15+
* [Releases v1.1.0](#releases-v110)
16+
* [Initial Releases v1.0.0](#initial-releases-v100)
17+
18+
---
19+
---
20+
21+
## Changelog
22+
23+
### Releases v1.1.0
24+
25+
1. Fix `multiple-definitions` linker error. Check [Different behaviour using the src_cpp or src_h lib #80](https://github.com/khoih-prog/ESPAsync_WiFiManager/discussions/80)
26+
2. Update all examples
27+
28+
### Initial Releases v1.0.0
29+
30+
1. Initial coding to support MBED nRF52840-based boards such as **Nano_33_BLE, Nano_33_BLE_Sense**, etc. using [**Arduino-mbed mbed_nano** core](https://github.com/arduino/ArduinoCore-mbed)
31+
32+

examples/FS_Counting/FS_Counting.ino

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
1.0.0 K Hoang 29/08/2021 Initial coding to support MBED nRF52840-based boards such as Nano_33_BLE, etc.
1515
*****************************************************************************************************************************/
1616

17+
#define FS_NANO33BLE_VERSION_MIN_TARGET "FS_Nano33BLE v1.1.0"
18+
#define FS_NANO33BLE_VERSION_MIN 1001000
19+
1720
#define _FS_LOGLEVEL_ 1
1821
#define NANO33BLE_FS_SIZE_KB 256
1922

@@ -38,6 +41,14 @@ void setup()
3841
Serial.print("\nStart FS_Counting on "); Serial.println(BOARD_NAME);
3942
Serial.println(FS_NANO33BLE_VERSION);
4043

44+
#if defined(FS_NANO33BLE_VERSION_MIN)
45+
if (FS_NANO33BLE_VERSION_INT < FS_NANO33BLE_VERSION_MIN)
46+
{
47+
Serial.print("Warning. Must use this example on Version equal or later than : ");
48+
Serial.println(FS_NANO33BLE_VERSION_MIN_TARGET);
49+
}
50+
#endif
51+
4152
myFS = new FileSystem_MBED();
4253

4354
if (!myFS->init())

examples/FS_Test/FS_Test.ino

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
1.0.0 K Hoang 29/08/2021 Initial coding to support MBED nRF52840-based boards such as Nano_33_BLE, etc.
1515
*****************************************************************************************************************************/
1616

17+
#define FS_NANO33BLE_VERSION_MIN_TARGET "FS_Nano33BLE v1.1.0"
18+
#define FS_NANO33BLE_VERSION_MIN 1001000
19+
1720
#define _FS_LOGLEVEL_ 1
1821
#define NANO33BLE_FS_SIZE_KB 256
1922

@@ -289,6 +292,14 @@ void setup()
289292
Serial.print("\nStart FS_Test on "); Serial.println(BOARD_NAME);
290293
Serial.println(FS_NANO33BLE_VERSION);
291294

295+
#if defined(FS_NANO33BLE_VERSION_MIN)
296+
if (FS_NANO33BLE_VERSION_INT < FS_NANO33BLE_VERSION_MIN)
297+
{
298+
Serial.print("Warning. Must use this example on Version equal or later than : ");
299+
Serial.println(FS_NANO33BLE_VERSION_MIN_TARGET);
300+
}
301+
#endif
302+
292303
myFS = new FileSystem_MBED();
293304

294305
if (!myFS->init())

keywords.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,9 @@ NANO33BLE_FLASH_SIZE LITERAL1
2020
NANO33BLE_FS_SIZE_KB LITERAL1
2121

2222
FS_MARK LITERAL1
23+
24+
FS_NANO33BLE_VERSION LITERAL1
25+
FS_NANO33BLE_VERSION_MAJOR LITERAL1
26+
FS_NANO33BLE_VERSION_MINOR LITERAL1
27+
FS_NANO33BLE_VERSION_PATCH LITERAL1
28+
FS_NANO33BLE_VERSION_INT LITERAL1

library.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "FS_Nano33BLE",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"keywords": "storage, data-storage, littlefs, littlefs-mbed, fatfs, fatfs-mbed, flash, flash-storage, posix, file-system, file, mbed, nano-33-ble, nano-33-ble-sense, nrf52840",
55
"description": "This library facilitates your usage of FS (FATFS or LittleFS) for the onboard flash. FS supports power fail safety and high performance",
66
"authors":
@@ -22,8 +22,9 @@
2222
"tests"
2323
]
2424
},
25+
"license": "GPL-3.0-or-later",
2526
"frameworks": "*",
26-
"platforms": ["mbed", "nrf52"],
27+
"platforms": ["mbed", "mbed_nano"],
2728
"examples": "examples/*/*/*.ino",
28-
"license": "GPL-3.0-or-later"
29+
"headers": "FS_Nano33BLE.h"
2930
}

library.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name=FS_Nano33BLE
2-
version=1.0.0
2+
version=1.1.0
33
author=Khoi Hoang <[email protected]>
44
maintainer=Khoi Hoang <[email protected]>
55
sentence=Wrapper of FS (FATFS or LittleFS) for Arduino MBED nRF52840-based boards, such as Nano_33_BLE boards
66
paragraph=This library facilitates your usage of FS (FATFS or LittleFS) for the onboard flash. FS supports power fail safety and high performance
77
category=Data Storage
88
url=https://github.com/khoih-prog/FS_Nano33BLE
99
repository=https://github.com/khoih-prog/FS_Nano33BLE
10-
architectures=mbed,mbed_nano,nrf52
11-
10+
architectures=mbed,mbed_nano
11+
includes=FS_Nano33BLE.h

0 commit comments

Comments
 (0)