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

Commit

Permalink
v1.1.0 to fix multiple-definitions linker error
Browse files Browse the repository at this point in the history
### 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
  • Loading branch information
khoih-prog committed Dec 31, 2021
1 parent 25f6f6d commit 2d13d7c
Show file tree
Hide file tree
Showing 9 changed files with 211 additions and 72 deletions.
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p

Please ensure to specify the following:

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

```
Arduino IDE version: 1.8.15
Arduino mbed_nano core v2.4.1
Arduino IDE version: 1.8.19
Arduino mbed_nano core v2.6.1
Nano_33_BLE board
OS: Ubuntu 20.04 LTS
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
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
Context:
I encountered a crash while using TimerInterrupt.
Expand Down
74 changes: 20 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@
* [Why do we need this FS_Nano33BLE library](#why-do-we-need-this-FS_Nano33BLE-library)
* [Features](#features)
* [Currently supported Boards](#currently-supported-boards)
* [Changelog](#changelog)
* [Initial Releases v1.0.0](#initial-releases-v100)
* [Changelog](changelog.md)
* [Prerequisites](#prerequisites)
* [Installation](#installation)
* [Use Arduino Library Manager](#use-arduino-library-manager)
* [Manual Install](#manual-install)
* [VS Code & PlatformIO](#vs-code--platformio)
* [HOWTO Fix `Multiple Definitions` Linker Error](#howto-fix-multiple-definitions-linker-error)
* [Examples](#examples)
* [ 1. FS_Counting](examples/FS_Counting)
* [ 2. FS_Test](examples/FS_Test)
Expand All @@ -32,7 +30,6 @@
* [3. FS_Test on Nano 33 BLE with FATFS size 256KB](#3-fs_test-on-nano-33-ble-with-fatfs-size-256kb)
* [Debug](#debug)
* [Troubleshooting](#troubleshooting)
* [Releases](#releases)
* [Issues](#issues)
* [TO DO](#to-do)
* [DONE](#done)
Expand All @@ -58,23 +55,13 @@ The filesystem access uses normal [POSIX APIs](https://www.tutorialspoint.com/c_

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)

---
---

## Changelog

### Initial Releases v1.0.0

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)


---
---

## Prerequisites

1. [`Arduino IDE 1.8.15+` for Arduino](https://www.arduino.cc/en/Main/Software)
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)
1. [`Arduino IDE 1.8.19+` for Arduino](https://www.arduino.cc/en/Main/Software)
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)

---
---
Expand Down Expand Up @@ -107,31 +94,6 @@ Another way to install is to:
---


### HOWTO Fix `Multiple Definitions` Linker Error

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

1. **scr_h** for new h-only files
2. **src_cpp** for standard h/cpp files

besides the standard **src** directory.

To use the **old standard cpp** way, locate this library' directory, then just

1. **Delete the all the files in src directory.**
2. **Copy all the files in src_cpp directory into src.**
3. Close then reopen the application code in Arduino IDE, etc. to recompile from scratch.

To re-use the **new h-only** way, just

1. **Delete the all the files in src directory.**
2. **Copy the files in src_h directory into src.**
3. Close then reopen the application code in Arduino IDE, etc. to recompile from scratch.

---
---


### Examples

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

```
#define FS_NANO33BLE_VERSION_MIN_TARGET "FS_Nano33BLE v1.1.0"
#define FS_NANO33BLE_VERSION_MIN 1001000
#define _FS_LOGLEVEL_ 1
#define NANO33BLE_FS_SIZE_KB 256
Expand Down Expand Up @@ -418,6 +383,14 @@ void setup()
Serial.print("\nStart FS_Test on "); Serial.println(BOARD_NAME);
Serial.println(FS_NANO33BLE_VERSION);
#if defined(FS_NANO33BLE_VERSION_MIN)
if (FS_NANO33BLE_VERSION_INT < FS_NANO33BLE_VERSION_MIN)
{
Serial.print("Warning. Must use this example on Version equal or later than : ");
Serial.println(FS_NANO33BLE_VERSION_MIN_TARGET);
}
#endif
myFS = new FileSystem_MBED();
if (!myFS->init())
Expand Down Expand Up @@ -480,23 +453,23 @@ The following is the sample terminal output when running example [FS_Counting](e

```
Start FS_Test on Nano 33 BLE
LittleFS_Nano33BLE v1.0.0
LittleFS_Nano33BLE v1.1.0
[LFS] LittleFS size (KB) = 256
[LFS] LittleFS Mount OK
Deleting file: /littlefs/counts.txt => OK
Times have been run = 1
=> Open to write OK
Start FS_Test on Nano 33 BLE
LittleFS_Nano33BLE v1.0.0
LittleFS_Nano33BLE v1.1.0
[LFS] LittleFS size (KB) = 256
[LFS] LittleFS Mount OK
=> Open to read OK
Times have been run = 2
=> Open to write OK
Start FS_Test on Nano 33 BLE
LittleFS_Nano33BLE v1.0.0
LittleFS_Nano33BLE v1.1.0
[LFS] LittleFS size (KB) = 256
[LFS] LittleFS Mount OK
=> Open to read OK
Expand All @@ -513,7 +486,7 @@ The following is the sample terminal output when running example [FS_Test](examp

```
Start FS_Test on Nano 33 BLE
LittleFS_Nano33BLE v1.0.0
LittleFS_Nano33BLE v1.1.0
[LFS] LittleFS size (KB) = 256
[LFS] LittleFS Mount Fail
[LFS] Formatting...
Expand Down Expand Up @@ -579,7 +552,7 @@ The following is the sample terminal output when running example [FS_Test](examp

```
Start FS_Test on Nano 33 BLE
FATFS_Nano33BLE v1.0.0
FATFS_Nano33BLE v1.1.0
[LFS] FATFS size (KB) = 256
[LFS] FATFS Mount OK
====================================================
Expand Down Expand Up @@ -661,14 +634,6 @@ Sometimes, the library will only work if you update the board core to the latest
---
---

## Releases

### Initial Releases v1.0.0

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)

---
---

### Issues

Expand All @@ -688,6 +653,7 @@ Submit issues to: [FS_Nano33BLE issues](https://github.com/khoih-prog/FS_Nano33B
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)
2. Add Version String
3. Add Table of Contents
4. Fix `multiple-definitions` linker error

---
---
Expand Down
32 changes: 32 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# FS_Nano33BLE Library

[![arduino-library-badge](https://www.ardu-badge.com/badge/FS_Nano33BLE.svg?)](https://www.ardu-badge.com/FS_Nano33BLE)
[![GitHub release](https://img.shields.io/github/release/khoih-prog/FS_Nano33BLE.svg)](https://github.com/khoih-prog/FS_Nano33BLE/releases)
[![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/khoih-prog/FS_Nano33BLE/blob/main/LICENSE)
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing)
[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/FS_Nano33BLE.svg)](http://github.com/khoih-prog/FS_Nano33BLE/issues)

---
---

## Table of Contents

* [Changelog](#changelog)
* [Releases v1.1.0](#releases-v110)
* [Initial Releases v1.0.0](#initial-releases-v100)

---
---

## Changelog

### Releases v1.1.0

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)
2. Update all examples

### Initial Releases v1.0.0

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)


11 changes: 11 additions & 0 deletions examples/FS_Counting/FS_Counting.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
1.0.0 K Hoang 29/08/2021 Initial coding to support MBED nRF52840-based boards such as Nano_33_BLE, etc.
*****************************************************************************************************************************/

#define FS_NANO33BLE_VERSION_MIN_TARGET "FS_Nano33BLE v1.1.0"
#define FS_NANO33BLE_VERSION_MIN 1001000

#define _FS_LOGLEVEL_ 1
#define NANO33BLE_FS_SIZE_KB 256

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

#if defined(FS_NANO33BLE_VERSION_MIN)
if (FS_NANO33BLE_VERSION_INT < FS_NANO33BLE_VERSION_MIN)
{
Serial.print("Warning. Must use this example on Version equal or later than : ");
Serial.println(FS_NANO33BLE_VERSION_MIN_TARGET);
}
#endif

myFS = new FileSystem_MBED();

if (!myFS->init())
Expand Down
11 changes: 11 additions & 0 deletions examples/FS_Test/FS_Test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
1.0.0 K Hoang 29/08/2021 Initial coding to support MBED nRF52840-based boards such as Nano_33_BLE, etc.
*****************************************************************************************************************************/

#define FS_NANO33BLE_VERSION_MIN_TARGET "FS_Nano33BLE v1.1.0"
#define FS_NANO33BLE_VERSION_MIN 1001000

#define _FS_LOGLEVEL_ 1
#define NANO33BLE_FS_SIZE_KB 256

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

#if defined(FS_NANO33BLE_VERSION_MIN)
if (FS_NANO33BLE_VERSION_INT < FS_NANO33BLE_VERSION_MIN)
{
Serial.print("Warning. Must use this example on Version equal or later than : ");
Serial.println(FS_NANO33BLE_VERSION_MIN_TARGET);
}
#endif

myFS = new FileSystem_MBED();

if (!myFS->init())
Expand Down
6 changes: 6 additions & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ NANO33BLE_FLASH_SIZE LITERAL1
NANO33BLE_FS_SIZE_KB LITERAL1

FS_MARK LITERAL1

FS_NANO33BLE_VERSION LITERAL1
FS_NANO33BLE_VERSION_MAJOR LITERAL1
FS_NANO33BLE_VERSION_MINOR LITERAL1
FS_NANO33BLE_VERSION_PATCH LITERAL1
FS_NANO33BLE_VERSION_INT LITERAL1
7 changes: 4 additions & 3 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "FS_Nano33BLE",
"version": "1.0.0",
"version": "1.1.0",
"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",
"description": "This library facilitates your usage of FS (FATFS or LittleFS) for the onboard flash. FS supports power fail safety and high performance",
"authors":
Expand All @@ -22,8 +22,9 @@
"tests"
]
},
"license": "GPL-3.0-or-later",
"frameworks": "*",
"platforms": ["mbed", "nrf52"],
"platforms": ["mbed", "mbed_nano"],
"examples": "examples/*/*/*.ino",
"license": "GPL-3.0-or-later"
"headers": "FS_Nano33BLE.h"
}
6 changes: 3 additions & 3 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name=FS_Nano33BLE
version=1.0.0
version=1.1.0
author=Khoi Hoang <khoih.prog@gmail.com>
maintainer=Khoi Hoang <khoih.prog@gmail.com>
sentence=Wrapper of FS (FATFS or LittleFS) for Arduino MBED nRF52840-based boards, such as Nano_33_BLE boards
paragraph=This library facilitates your usage of FS (FATFS or LittleFS) for the onboard flash. FS supports power fail safety and high performance
category=Data Storage
url=https://github.com/khoih-prog/FS_Nano33BLE
repository=https://github.com/khoih-prog/FS_Nano33BLE
architectures=mbed,mbed_nano,nrf52

architectures=mbed,mbed_nano
includes=FS_Nano33BLE.h
Loading

0 comments on commit 2d13d7c

Please sign in to comment.