Skip to content

Commit 44e02e1

Browse files
committed
Merge remote-tracking branch 'origin/maintenance-8.x.x'
2 parents fb31952 + 0442b56 commit 44e02e1

File tree

30 files changed

+569
-130
lines changed

30 files changed

+569
-130
lines changed

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ else()
5151
endif()
5252
endif()
5353

54-
55-
project(INAV VERSION 9.0.0)
54+
project(INAV VERSION 8.0.1)
5655

5756
enable_language(ASM)
5857

docs/ADSB.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ All ADSB receivers which can send Mavlink [ADSB_VEHICLE](https://mavlink.io/en/m
1313

1414
* [PINGRX](https://uavionix.com/product/pingrx-pro/) (not tested)
1515
* [TT-SC1](https://www.aerobits.pl/product/aero/) (tested)
16+
* [ADSBee1090](https://pantsforbirds.com/adsbee-1090/) (tested)
1617

1718
## TT-SC1 settings
1819
* download software for ADSB TT-SC1 from https://www.aerobits.pl/product/aero/ , file Micro_ADSB_App-vX.XX.X_win_setup.zip and install it
@@ -24,3 +25,21 @@ All ADSB receivers which can send Mavlink [ADSB_VEHICLE](https://mavlink.io/en/m
2425
PCB board for TT-SC1-B module https://oshwlab.com/error414/adsb-power-board
2526
![TT-SC1 settings](Screenshots/ADSB_TTSC01_settings.png)
2627

28+
## ADSBee 1090 settings
29+
* connect to ADSBee1090 via USB and set COMMS_UART to mavlink2 \
30+
``
31+
AT+PROTOCOL=COMMS_UART,MAVLINK2
32+
``\
33+
``
34+
AT+BAUDRATE=COMMS_UART,115200
35+
``\
36+
It's recommended to turn of wifi \
37+
``
38+
AT+ESP32_ENABLE=0
39+
``\
40+
``
41+
AT+SETTINGS=SAVE
42+
``
43+
* in INAV configurator ports TAB set telemetry MAVLINK, and baudrate 115200
44+
* https://pantsforbirds.com/adsbee-1090/quick-start/
45+

docs/OSD.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ Not all OSDs are created equally. This table shows the differences between the d
2323
| DJI WTFOS | 60 x 22 | X | | X | YES |
2424
| HDZero | 50 x 18 | X | | X | YES |
2525
| Avatar | 53 x 20 | X | | X | YES |
26-
| DJI O3 | 53 x 20 (HD) | X | | X (partial) | NO - BF Characters only |
2726
| DJI O3 Goggles V2 + WTFOS | 53 x 20 | X | | X | YES |
27+
| DJI Goggles 2 and newer | 53 x 20 (HD) | X | | X | YES (no custom fonts) |
2828

2929
## OSD Elements
3030
Here are the OSD Elements provided by INAV.

lib/main/STM32H7/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_mdma.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
#ifdef USE_FULL_ASSERT
2424
#include "stm32_assert.h"
2525
#else
26+
#ifndef assert_param
2627
#define assert_param(expr) ((void)0U)
2728
#endif
29+
#endif
2830

2931
/** @addtogroup STM32H7xx_LL_Driver
3032
* @{

lib/main/STM32H7/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_rcc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
#ifdef USE_FULL_ASSERT
2323
#include "stm32_assert.h"
2424
#else
25+
#ifndef assert_param
2526
#define assert_param(expr) ((void)0U)
2627
#endif
28+
#endif
2729

2830
/** @addtogroup STM32H7xx_LL_Driver
2931
* @{

src/main/config/config_eeprom.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ void initEEPROM(void)
118118
BUILD_BUG_ON(sizeof(configFooter_t) != 2);
119119
BUILD_BUG_ON(sizeof(configRecord_t) != 6);
120120

121+
#ifdef STM32H7A3xx
122+
BUILD_BUG_ON(CONFIG_STREAMER_BUFFER_SIZE != 16);
123+
#elif defined(STM32H743xx)
124+
BUILD_BUG_ON(CONFIG_STREAMER_BUFFER_SIZE != 32);
125+
#endif
126+
121127
#if defined(CONFIG_IN_EXTERNAL_FLASH)
122128
bool eepromLoaded = loadEEPROMFromExternalFlash();
123129
if (!eepromLoaded) {

src/main/config/config_streamer.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ int config_streamer_write(config_streamer_t *c, const uint8_t *p, uint32_t size)
5555
return -1;
5656
}
5757

58-
for (const uint8_t *pat = p; pat != (uint8_t*)p + size; pat++) {
58+
for (const uint8_t *pat = p; pat != (uint8_t *)p + size; pat++) {
5959
c->buffer.b[c->at++] = *pat;
6060

6161
if (c->at == sizeof(c->buffer)) {
@@ -81,7 +81,7 @@ int config_streamer_flush(config_streamer_t *c)
8181
c->err = config_streamer_impl_write_word(c, &c->buffer.w);
8282
c->at = 0;
8383
}
84-
return c-> err;
84+
return c->err;
8585
}
8686

8787
int config_streamer_finish(config_streamer_t *c)
@@ -91,4 +91,4 @@ int config_streamer_finish(config_streamer_t *c)
9191
c->unlocked = false;
9292
}
9393
return c->err;
94-
}
94+
}

src/main/config/config_streamer.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,14 @@
2727

2828
#ifdef CONFIG_IN_EXTERNAL_FLASH
2929
#define CONFIG_STREAMER_BUFFER_SIZE M25P16_PAGESIZE // Must match flash device page size
30-
typedef uint32_t config_streamer_buffer_align_type_t;
3130
#elif defined(STM32H7)
32-
#define CONFIG_STREAMER_BUFFER_SIZE 32 // Flash word = 256-bits
33-
typedef uint64_t config_streamer_buffer_align_type_t;
31+
#define CONFIG_STREAMER_BUFFER_SIZE (FLASH_NB_32BITWORD_IN_FLASHWORD * 4) // Flash word = 256-bits or 128bits, depending on the mcu
3432
#else
3533
#define CONFIG_STREAMER_BUFFER_SIZE 4
36-
typedef uint32_t config_streamer_buffer_align_type_t;
3734
#endif
3835

36+
typedef uint32_t config_streamer_buffer_align_type_t;
37+
3938
typedef struct config_streamer_s {
4039
uintptr_t address;
4140
uintptr_t end;

src/main/config/config_streamer_stm32h7.c

Lines changed: 62 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,45 @@
1515
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

18-
#include <string.h>
19-
#include "platform.h"
20-
#include "drivers/system.h"
21-
#include "config/config_streamer.h"
18+
#include <string.h>
19+
#include "platform.h"
20+
#include "drivers/system.h"
21+
#include "config/config_streamer.h"
22+
23+
#if defined(STM32H7) && !defined(CONFIG_IN_RAM) && !defined(CONFIG_IN_EXTERNAL_FLASH)
2224

23-
#if defined(STM32H7) && !defined(CONFIG_IN_RAM) && !defined(CONFIG_IN_EXTERNAL_FLASH)
25+
static uint32_t getFLASHBankForEEPROM(uint32_t address)
26+
{
27+
#ifdef DUAL_BANK
28+
if (address < (FLASH_BASE + FLASH_BANK_SIZE)) {
29+
return FLASH_BANK_1;
30+
}
31+
32+
return FLASH_BANK_2;
33+
#else
34+
return FLASH_BANK_1;
35+
#endif
36+
}
37+
38+
#if defined(STM32H7A3xx)
39+
static uint32_t getFLASHSectorForEEPROM(uint32_t address)
40+
{
41+
uint32_t sector = 0;
42+
43+
if (address < (FLASH_BASE + FLASH_BANK_SIZE)) {
44+
sector = (address - FLASH_BASE) / FLASH_SECTOR_SIZE;
45+
} else {
46+
sector = (address - (FLASH_BASE + FLASH_BANK_SIZE)) / FLASH_SECTOR_SIZE;
47+
}
2448

25-
#if defined(STM32H743xx)
49+
if (sector > FLASH_SECTOR_TOTAL) {
50+
failureMode(FAILURE_FLASH_WRITE_FAILED);
51+
}
52+
53+
return sector;
54+
}
55+
#elif defined(STM32H743xx)
2656
/* Sectors 0-7 of 128K each */
27-
#define FLASH_PAGE_SIZE ((uint32_t)0x20000) // 128K sectors
2857
static uint32_t getFLASHSectorForEEPROM(uint32_t address)
2958
{
3059
if (address <= 0x0801FFFF)
@@ -49,9 +78,9 @@ static uint32_t getFLASHSectorForEEPROM(uint32_t address)
4978
}
5079
}
5180
#elif defined(STM32H750xx)
52-
# error "STM32750xx only has one flash page which contains the bootloader, no spare flash pages available, use external storage for persistent config or ram for target testing"
81+
#error "STM32750xx only has one flash page which contains the bootloader, no spare flash pages available, use external storage for persistent config or ram for target testing"
5382
#else
54-
# error "Unsupported CPU!"
83+
#error "Unsupported CPU!"
5584
#endif
5685

5786
void config_streamer_impl_unlock(void)
@@ -70,30 +99,31 @@ int config_streamer_impl_write_word(config_streamer_t *c, config_streamer_buffer
7099
return c->err;
71100
}
72101

73-
if (c->address % FLASH_PAGE_SIZE == 0) {
102+
if (c->address % FLASH_SECTOR_SIZE == 0) {
74103
FLASH_EraseInitTypeDef EraseInitStruct = {
75-
.TypeErase = FLASH_TYPEERASE_SECTORS,
76-
.VoltageRange = FLASH_VOLTAGE_RANGE_3, // 2.7-3.6V
77-
.NbSectors = 1,
78-
.Banks = FLASH_BANK_1
79-
};
80-
EraseInitStruct.Sector = getFLASHSectorForEEPROM(c->address);
81-
82-
uint32_t SECTORError;
83-
const HAL_StatusTypeDef status = HAL_FLASHEx_Erase(&EraseInitStruct, &SECTORError);
84-
if (status != HAL_OK) {
85-
return -1;
86-
}
87-
}
104+
.TypeErase = FLASH_TYPEERASE_SECTORS,
105+
#ifdef FLASH_VOLTAGE_RANGE_3
106+
.VoltageRange = FLASH_VOLTAGE_RANGE_3, // 2.7-3.6V
107+
#endif
108+
.NbSectors = 1};
109+
EraseInitStruct.Banks = getFLASHBankForEEPROM(c->address);
110+
EraseInitStruct.Sector = getFLASHSectorForEEPROM(c->address);
88111

89-
// On H7 HAL_FLASH_Program takes data address, not the raw word value
90-
const HAL_StatusTypeDef status = HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, c->address, (uint32_t)buffer);
91-
if (status != HAL_OK) {
92-
return -2;
93-
}
112+
uint32_t SECTORError;
113+
const HAL_StatusTypeDef status = HAL_FLASHEx_Erase(&EraseInitStruct, &SECTORError);
114+
if (status != HAL_OK) {
115+
return -1;
116+
}
117+
}
94118

95-
c->address += CONFIG_STREAMER_BUFFER_SIZE;
96-
return 0;
97-
}
119+
// On H7 HAL_FLASH_Program takes data address, not the raw word value
120+
const HAL_StatusTypeDef status = HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, c->address, (uint32_t)buffer);
121+
if (status != HAL_OK) {
122+
return -2;
123+
}
98124

99-
#endif
125+
c->address += CONFIG_STREAMER_BUFFER_SIZE;
126+
return 0;
127+
}
128+
129+
#endif

src/main/drivers/bus_spi.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ typedef enum SPIDevice {
6767
#define SPIDEV_COUNT 4
6868
#endif
6969

70+
#if defined(AT32F43x)
71+
typedef spi_type SPI_TypeDef;
72+
#endif
73+
7074
typedef struct SPIDevice_s {
7175
#if defined(AT32F43x)
7276
spi_type *dev;

0 commit comments

Comments
 (0)