Skip to content

Commit 1181f02

Browse files
author
JeromeGalan
authored
Merge pull request #253 from Luos-io/rc_2.5.0
Luos_engine - Release 2.5.0
2 parents 65321ff + 4d33ee5 commit 1181f02

File tree

421 files changed

+12297
-5627
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

421 files changed

+12297
-5627
lines changed

.github/ISSUE_TEMPLATE/porting-request.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Don't hesitate to post a schematic.
1919

2020
**Ensure that every box bellow is checked:**
2121
- [ ] The MCU is not in the [compatible list](https://docs.luos.io/docs/next/compatibility/mcu_demoboard) in the documentation.
22-
- [ ] The MCU is not already in an existing [porting issue](https://github.com/Luos-io/Luos/issues).
22+
- [ ] The MCU is not already in an existing [porting issue](https://github.com/Luos-io/luos_engine/issues).
2323
- [x] The issue has the label `porting`.
2424
- [ ] The issue is added to the [Porting](https://github.com/orgs/Luos-io/projects/3) project.
2525

.github/workflows/build.yml

+11-15
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ jobs:
4343
if: ${{ runner.os != 'Windows' }}
4444
run: python .github/workflows/run-clang-format.py -r .
4545

46+
- name: Run PlatformIO Unit Tests
47+
env:
48+
PLATFORMIO_LIB_EXTRA_DIRS: ${{ matrix.pio_lib_path }}
49+
if: ${{ runner.os == 'Windows' }}
50+
run: |
51+
# Clean all projects
52+
platformio run -t clean -c .\test\_resources\platformio.ini
53+
54+
# Run Unit tests
55+
platformio test -c .\test\_resources\platformio.ini -vvv
56+
4657
- name: Run PlatformIO
4758
run: |
4859
# L0
@@ -124,18 +135,3 @@ jobs:
124135
platformio run -d examples/projects/NUCLEO-F072RB/bootloader
125136
# SAMD21XPLAINED
126137
# ******** missing bootloader CI ********
127-
128-
- name: Run PlatformIO Unit Tests
129-
env:
130-
PLATFORMIO_LIB_EXTRA_DIRS: ${{ matrix.pio_lib_path }}
131-
if: ${{ runner.os == 'Windows' }}
132-
run: |
133-
# Clean all projects
134-
platformio run -t clean -c .\test\_resources\platformio.ini
135-
136-
# Run Unit tests
137-
platformio test -c .\test\_resources\platformio.ini --verbose `
138-
-f msg_alloc `
139-
-f luos `
140-
-f routing_table `
141-
-f timestamp

.github/workflows/dev-build.yml

+11-15
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ jobs:
4343
if: ${{ runner.os != 'Windows' }}
4444
run: python .github/workflows/run-clang-format.py -r .
4545

46+
- name: Run PlatformIO Unit Tests
47+
env:
48+
PLATFORMIO_LIB_EXTRA_DIRS: ${{ matrix.pio_lib_path }}
49+
if: ${{ runner.os == 'Windows' }}
50+
run: |
51+
# Clean all projects
52+
platformio run -t clean -c .\test\_resources\platformio.ini
53+
54+
# Run Unit tests
55+
platformio test -c .\test\_resources\platformio.ini -vvv
56+
4657
- name: Run PlatformIO
4758
run: |
4859
# L0
@@ -122,18 +133,3 @@ jobs:
122133
platformio run -d examples/projects/NUCLEO-F072RB/bootloader
123134
# SAMD21XPLAINED
124135
# ******** missing bootloader CI ********
125-
126-
- name: Run PlatformIO Unit Tests
127-
env:
128-
PLATFORMIO_LIB_EXTRA_DIRS: ${{ matrix.pio_lib_path }}
129-
if: ${{ runner.os == 'Windows' }}
130-
run: |
131-
# Clean all projects
132-
platformio run -t clean -c .\test\_resources\platformio.ini
133-
134-
# Run Unit tests
135-
platformio test -c .\test\_resources\platformio.ini --verbose `
136-
-f msg_alloc `
137-
-f luos `
138-
-f routing_table `
139-
-f timestamp

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ Pull requests are the best way to propose changes to the codebase. We actively w
3030
## Any contributions to a driver and/or an application you make will be under the [MIT Software License](http://choosealicense.com/licenses/mit/)
3131
In short, when you submit code changes to drivers and apps, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern.
3232

33-
## Any contributions to Luos core technology you make will be under the [Luos License](https://github.com/Luos-io/Luos/blob/master/LICENSE.md)
34-
In short, when you submit code changes to Luos core technology, your submissions are understood to be under the [Luos License](https://github.com/Luos-io/Luos/blob/master/LICENSE.md) that covers the project. Feel free to contact the maintainers if that's a concern.
33+
## Any contributions to Luos core technology you make will be under the [Luos License](https://github.com/Luos-io/luos_engine/blob/master/LICENSE.md)
34+
In short, when you submit code changes to Luos core technology, your submissions are understood to be under the [Luos License](https://github.com/Luos-io/luos_engine/blob/master/LICENSE.md) that covers the project. Feel free to contact the maintainers if that's a concern.
3535

3636
## Write bug reports with detail, background, and sample code
3737
Great Bug Reports tend to have:

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<a href="https://luos.io"><img src="https://uploads-ssl.webflow.com/601a78a2b5d030260a40b7ad/603e0cc45afbb50963aa85f2_Gif%20noir%20rect.gif" alt="Luos logo" title="Luos" align="right" height="100" /></a>
22

3-
![](https://github.com/Luos-io/Luos/actions/workflows/build.yml/badge.svg)
4-
[![](https://img.shields.io/github/license/Luos-io/luos_engine)](https://github.com/Luos-io/Luos/blob/master/LICENSE)
3+
![](https://github.com/Luos-io/luos_engine/actions/workflows/build.yml/badge.svg)
4+
[![](https://img.shields.io/github/license/Luos-io/luos_engine)](https://github.com/Luos-io/luos_engine/blob/master/LICENSE)
55

66
[![](https://img.shields.io/badge/Luos-Documentation-34A3B4)](https://docs.luos.io)
77
[![](http://certified.luos.io)](https://luos.io)
8-
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/luos/library/luos_engine.svg)](https://registry.platformio.org/libraries/luos/luos_engine)
8+
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/luos_engine/library/luos_engine.svg)](https://registry.platformio.org/libraries/luos_engine/luos_engine)
99

1010
[![](https://img.shields.io/discord/902486791658041364?label=Discord&logo=discord&style=social)](http://bit.ly/JoinLuosDiscord)
1111
[![](https://img.shields.io/reddit/subreddit-subscribers/Luos?style=social)](https://www.reddit.com/r/Luos)
1212
[![](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Unleash%20electronic%20devices%20as%20microservices%20thanks%20to%20Luos&https://luos.io&via=Luos_io&hashtags=embeddedsystems,electronics,microservices,api)
1313
[![](https://img.shields.io/badge/LinkedIn-Share-0077B5?style=social&logo=linkedin)](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fgithub.com%2Fluos-io)
1414

15-
Version: 2.4.2
15+
Version: 2.5.0
1616

1717
# Luos Technology
1818
## The most for the developer​

engine/HAL/ATSAMD21/luos_hal.c

-61
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ static ll_timestamp_t ll_timestamp;
2929
******************************************************************************/
3030
static void LuosHAL_SystickInit(void);
3131
static void LuosHAL_FlashInit(void);
32-
static void LuosHAL_FlashEraseLuosMemoryInfo(void);
3332

3433
/////////////////////////Luos Library Needed function///////////////////////////
3534

@@ -141,66 +140,6 @@ static void LuosHAL_FlashInit(void)
141140
NVMCTRL_REGS->NVMCTRL_CTRLB = NVMCTRL_CTRLB_READMODE_NO_MISS_PENALTY | NVMCTRL_CTRLB_SLEEPPRM_WAKEONACCESS
142141
| NVMCTRL_CTRLB_RWS(1) | NVMCTRL_CTRLB_MANW_Msk;
143142
}
144-
/******************************************************************************
145-
* @brief Erase flash page where Luos keep permanente information
146-
* @param None
147-
* @return None
148-
******************************************************************************/
149-
static void LuosHAL_FlashEraseLuosMemoryInfo(void)
150-
{
151-
uint32_t address = ADDRESS_ALIASES_FLASH;
152-
NVMCTRL_REGS->NVMCTRL_ADDR = address >> 1;
153-
NVMCTRL_REGS->NVMCTRL_CTRLA = NVMCTRL_CTRLA_CMD_ER_Val | NVMCTRL_CTRLA_CMDEX_KEY;
154-
NVMCTRL_REGS->NVMCTRL_ADDR = (address + 256) >> 1;
155-
NVMCTRL_REGS->NVMCTRL_CTRLA = NVMCTRL_CTRLA_CMD_ER_Val | NVMCTRL_CTRLA_CMDEX_KEY;
156-
NVMCTRL_REGS->NVMCTRL_ADDR = (address + 512) >> 1;
157-
NVMCTRL_REGS->NVMCTRL_CTRLA = NVMCTRL_CTRLA_CMD_ER_Val | NVMCTRL_CTRLA_CMDEX_KEY;
158-
NVMCTRL_REGS->NVMCTRL_ADDR = (address + 768) >> 1;
159-
NVMCTRL_REGS->NVMCTRL_CTRLA = NVMCTRL_CTRLA_CMD_ER_Val | NVMCTRL_CTRLA_CMDEX_KEY;
160-
}
161-
/******************************************************************************
162-
* @brief Write flash page where Luos keep permanente information
163-
* @param Address page / size to write / pointer to data to write
164-
* @return
165-
******************************************************************************/
166-
void LuosHAL_FlashWriteLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data)
167-
{
168-
uint32_t i = 0;
169-
uint32_t *paddress = (uint32_t *)addr;
170-
171-
// Before writing we have to erase the entire page
172-
// to do that we have to backup current falues by copying it into RAM
173-
uint8_t page_backup[16 * PAGE_SIZE];
174-
memcpy(page_backup, (void *)ADDRESS_ALIASES_FLASH, 16 * PAGE_SIZE);
175-
176-
// Now we can erase the page
177-
LuosHAL_FlashEraseLuosMemoryInfo();
178-
179-
// Then add input data into backuped value on RAM
180-
uint32_t RAMaddr = (addr - ADDRESS_ALIASES_FLASH);
181-
memcpy(&page_backup[RAMaddr], data, size);
182-
183-
/* writing 32-bit data into the given address */
184-
for (i = 0; i < (PAGE_SIZE / 4); i++)
185-
{
186-
*paddress++ = page_backup[i];
187-
}
188-
189-
/* Set address and command */
190-
NVMCTRL_REGS->NVMCTRL_ADDR = addr >> 1;
191-
192-
NVMCTRL_REGS->NVMCTRL_CTRLA = NVMCTRL_CTRLA_CMD_WP | NVMCTRL_CTRLA_CMDEX_KEY;
193-
}
194-
/******************************************************************************
195-
* @brief read information from page where Luos keep permanente information
196-
* @param Address info / size to read / pointer callback data to read
197-
* @return
198-
******************************************************************************/
199-
void LuosHAL_FlashReadLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data)
200-
{
201-
memcpy(data, (void *)(addr), size);
202-
}
203-
204143
/******************************************************************************
205144
* @brief Set boot mode in shared flash memory
206145
* @param

engine/HAL/ATSAMD21/luos_hal.h

-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#define NODE_ID_MASK 0x00FFFF00
2222
#define NODE_ID_OFFSET 8
2323

24-
#define ADDRESS_ALIASES_FLASH ADDRESS_LAST_PAGE_FLASH
2524
#define ADDRESS_BOOT_FLAG_FLASH (ADDRESS_LAST_PAGE_FLASH + PAGE_SIZE) - 4
2625

2726
/*******************************************************************************
@@ -42,8 +41,6 @@ typedef struct ll_timestamp
4241
void LuosHAL_Init(void);
4342
void LuosHAL_SetIrqState(uint8_t Enable);
4443
uint32_t LuosHAL_GetSystick(void);
45-
void LuosHAL_FlashWriteLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data);
46-
void LuosHAL_FlashReadLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data);
4744

4845
// bootloader functions
4946
void LuosHAL_SetMode(uint8_t mode);

engine/HAL/ATSAMD21/luos_hal_config.h

-16
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,6 @@
1717
#define MCUFREQ 48000000 // MCU frequence
1818
#endif
1919

20-
/*******************************************************************************
21-
* FLASH CONFIG
22-
******************************************************************************/
23-
#ifndef PAGE_SIZE
24-
#define PAGE_SIZE 64
25-
#endif
26-
#ifndef ERASE_SIZE
27-
#define ERASE_SIZE 256
28-
#endif
29-
#ifndef FLASH_SIZE
30-
#define FLASH_SIZE 0x40000
31-
#endif
32-
#ifndef ADDRESS_LAST_PAGE_FLASH
33-
#define ADDRESS_LAST_PAGE_FLASH FLASH_SIZE - (16 * PAGE_SIZE)
34-
#endif
35-
3620
/*******************************************************************************
3721
* BOOTLOADER CONFIG
3822
******************************************************************************/

engine/HAL/ATSAMD21_ARDUINO/luos_hal.c

-61
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ static ll_timestamp_t ll_timestamp;
2929
******************************************************************************/
3030
static void LuosHAL_SystickInit(void);
3131
static void LuosHAL_FlashInit(void);
32-
static void LuosHAL_FlashEraseLuosMemoryInfo(void);
3332

3433
/////////////////////////Luos Library Needed function///////////////////////////
3534

@@ -133,66 +132,6 @@ static void LuosHAL_FlashInit(void)
133132
NVMCTRL->CTRLB.reg = NVMCTRL_CTRLB_READMODE_NO_MISS_PENALTY | NVMCTRL_CTRLB_SLEEPPRM_WAKEONACCESS
134133
| NVMCTRL_CTRLB_RWS(1) | NVMCTRL_CTRLB_MANW;
135134
}
136-
/******************************************************************************
137-
* @brief Erase flash page where Luos keep permanente information
138-
* @param None
139-
* @return None
140-
******************************************************************************/
141-
static void LuosHAL_FlashEraseLuosMemoryInfo(void)
142-
{
143-
uint32_t address = ADDRESS_ALIASES_FLASH;
144-
NVMCTRL->ADDR.reg = address >> 1;
145-
NVMCTRL->CTRLA.reg = NVMCTRL_CTRLA_CMD_ER_Val | NVMCTRL_CTRLA_CMDEX_KEY;
146-
NVMCTRL->ADDR.reg = (address + 256) >> 1;
147-
NVMCTRL->CTRLA.reg = NVMCTRL_CTRLA_CMD_ER_Val | NVMCTRL_CTRLA_CMDEX_KEY;
148-
NVMCTRL->ADDR.reg = (address + 512) >> 1;
149-
NVMCTRL->CTRLA.reg = NVMCTRL_CTRLA_CMD_ER_Val | NVMCTRL_CTRLA_CMDEX_KEY;
150-
NVMCTRL->ADDR.reg = (address + 768) >> 1;
151-
NVMCTRL->CTRLA.reg = NVMCTRL_CTRLA_CMD_ER_Val | NVMCTRL_CTRLA_CMDEX_KEY;
152-
}
153-
/******************************************************************************
154-
* @brief Write flash page where Luos keep permanente information
155-
* @param Address page / size to write / pointer to data to write
156-
* @return
157-
******************************************************************************/
158-
void LuosHAL_FlashWriteLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data)
159-
{
160-
uint32_t i = 0;
161-
uint32_t *paddress = (uint32_t *)addr;
162-
163-
// Before writing we have to erase the entire page
164-
// to do that we have to backup current falues by copying it into RAM
165-
uint8_t page_backup[16 * PAGE_SIZE];
166-
memcpy(page_backup, (void *)ADDRESS_ALIASES_FLASH, 16 * PAGE_SIZE);
167-
168-
// Now we can erase the page
169-
LuosHAL_FlashEraseLuosMemoryInfo();
170-
171-
// Then add input data into backuped value on RAM
172-
uint32_t RAMaddr = (addr - ADDRESS_ALIASES_FLASH);
173-
memcpy(&page_backup[RAMaddr], data, size);
174-
175-
/* writing 32-bit data into the given address */
176-
for (i = 0; i < (PAGE_SIZE / 4); i++)
177-
{
178-
*paddress++ = page_backup[i];
179-
}
180-
181-
/* Set address and command */
182-
NVMCTRL->ADDR.reg = addr >> 1;
183-
184-
NVMCTRL->CTRLA.reg = NVMCTRL_CTRLA_CMD_WP_Val | NVMCTRL_CTRLA_CMDEX_KEY;
185-
}
186-
/******************************************************************************
187-
* @brief read information from page where Luos keep permanente information
188-
* @param Address info / size to read / pointer callback data to read
189-
* @return
190-
******************************************************************************/
191-
void LuosHAL_FlashReadLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data)
192-
{
193-
memcpy(data, (void *)(addr), size);
194-
}
195-
196135
/******************************************************************************
197136
* @brief Set boot mode in shared flash memory
198137
* @param

engine/HAL/ATSAMD21_ARDUINO/luos_hal.h

-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#define NODE_ID_MASK 0x00FFFF00
2222
#define NODE_ID_OFFSET 8
2323

24-
#define ADDRESS_ALIASES_FLASH ADDRESS_LAST_PAGE_FLASH
2524
#define ADDRESS_BOOT_FLAG_FLASH (ADDRESS_LAST_PAGE_FLASH + PAGE_SIZE) - 4
2625

2726
/*******************************************************************************
@@ -42,8 +41,6 @@ typedef struct ll_timestamp
4241
void LuosHAL_Init(void);
4342
void LuosHAL_SetIrqState(uint8_t Enable);
4443
uint32_t LuosHAL_GetSystick(void);
45-
void LuosHAL_FlashWriteLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data);
46-
void LuosHAL_FlashReadLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data);
4744

4845
// bootloader functions
4946
void LuosHAL_SetMode(uint8_t mode);

engine/HAL/ATSAMD21_ARDUINO/luos_hal_config.h

-15
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,6 @@
1616
#ifndef MCUFREQ
1717
#define MCUFREQ 48000000 // MCU frequence
1818
#endif
19-
/*******************************************************************************
20-
* FLASH CONFIG
21-
******************************************************************************/
22-
#ifndef PAGE_SIZE
23-
#define PAGE_SIZE 64
24-
#endif
25-
#ifndef ERASE_SIZE
26-
#define ERASE_SIZE 256
27-
#endif
28-
#ifndef FLASH_SIZE
29-
#define FLASH_SIZE 0x40000
30-
#endif
31-
#ifndef ADDRESS_LAST_PAGE_FLASH
32-
#define ADDRESS_LAST_PAGE_FLASH FLASH_SIZE - (16 * PAGE_SIZE)
33-
#endif
3419

3520
/*******************************************************************************
3621
* BOOTLOADER CONFIG

0 commit comments

Comments
 (0)