Skip to content

Commit c2a83ad

Browse files
authored
Update libraries (#285)
* Update SDK libs - Update System Folder - Update all .a libs - Update USB examples * Update platform.txt * Update getIPv6 and OTA * Update CI_compile_examples.yml
1 parent 313b7ba commit c2a83ad

File tree

276 files changed

+46084
-7371
lines changed

Some content is hidden

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

276 files changed

+46084
-7371
lines changed

.github/workflows/CI_compile_examples.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ jobs:
4949
#- Arduino_package/hardware/libraries/Preferences
5050
- Arduino_package/hardware/libraries/RTC
5151
- Arduino_package/hardware/libraries/SoftwareSerial
52-
- Arduino_package/hardware/libraries/SPI
52+
#- Arduino_package/hardware/libraries/SPI
53+
#- Arduino_package/hardware/libraries/SPI/examples/BW16_SD_Card_SPI
54+
- Arduino_package/hardware/libraries/SPI/examples/ILI9341_TFT_LCD_PM2.5
55+
- Arduino_package/hardware/libraries/SPI/examples/ILI9341_TFT_LCD_basic
56+
- Arduino_package/hardware/libraries/SPI/examples/SparkFun_ADXL313_SPI
5357
- Arduino_package/hardware/libraries/Sys
5458
- Arduino_package/hardware/libraries/USB
5559
- Arduino_package/hardware/libraries/Watchdog

Arduino_package/hardware/cores/ambd/wifi_drv.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,15 @@ void WiFiDrv::getIpAddress(IPAddress& ip, uint8_t interface) {
470470
}
471471

472472
void WiFiDrv::getIpv6Address() {
473-
LwIP_AUTOIP_IPv6(&xnetif[0]);
473+
uint8_t *ipv6Address =LwIP_GetIPv6_linklocal(&xnetif[0]);
474+
printf("\nIPv6 link-local address: "
475+
"%02x%02x:%02x%02x:%02x%02x:%02x%02x:"
476+
"%02x%02x:%02x%02x:%02x%02x:%02x%02x\n",
477+
ipv6Address[0], ipv6Address[1], ipv6Address[2], ipv6Address[3],
478+
ipv6Address[4], ipv6Address[5], ipv6Address[6], ipv6Address[7],
479+
ipv6Address[8], ipv6Address[9], ipv6Address[10], ipv6Address[11],
480+
ipv6Address[12], ipv6Address[13], ipv6Address[14], ipv6Address[15]);
481+
474482
while (!ip6_addr_isvalid(netif_ip6_addr_state(&xnetif[0],0))) {
475483
vTaskDelay(10);
476484
}

Arduino_package/hardware/libraries/OTA/src/OTA.cpp

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,31 @@ OTA::~OTA(){};
3535
*
3636
***********************************************************************************/
3737

38+
uint32_t OTA::getOTACurAddr(void) {
39+
uint32_t AddrStart, Offset, IsMinus, PhyAddr;;
40+
41+
RSIP_REG_TypeDef* RSIP = ((RSIP_REG_TypeDef *) RSIP_REG_BASE);
42+
uint32_t CtrlTemp = RSIP->FLASH_MMU[0].MMU_ENTRYx_CTRL;
43+
44+
if (CtrlTemp & MMU_BIT_ENTRY_VALID) {
45+
AddrStart = RSIP->FLASH_MMU[0].MMU_ENTRYx_STRADDR;
46+
Offset = RSIP->FLASH_MMU[0].MMU_ENTRYx_OFFSET;
47+
IsMinus = CtrlTemp & MMU_BIT_ENTRY_OFFSET_MINUS;
48+
49+
if(IsMinus)
50+
PhyAddr = AddrStart - Offset;
51+
else
52+
PhyAddr = AddrStart + Offset;
53+
54+
if(PhyAddr == LS_IMG2_OTA1_ADDR)
55+
return OTA_INDEX_1;
56+
else if(PhyAddr == LS_IMG2_OTA2_ADDR)
57+
return OTA_INDEX_2;
58+
}
59+
60+
return OTA_INDEX_1;
61+
}
62+
3863
void OTA::beginOTA(int port)
3964
{
4065
int server_socket = -1, client_socket = -1;
@@ -63,7 +88,7 @@ void OTA::beginOTA(int port)
6388
}
6489
syncOTAAddr(ota_target_index);
6590

66-
if (ota_get_cur_index() == OTA_INDEX_1) {
91+
if (getOTACurAddr() == OTA_INDEX_1) {
6792
ota_target_index = OTA_INDEX_2;
6893
printf("Current index = 1, Target index = 2\n");
6994
} else {
@@ -152,7 +177,7 @@ void OTA::beginOTA(int port)
152177
void OTA::syncOTAAddr(u32 ota_target_index)
153178
{
154179
/* check OTA index we should update */
155-
if (ota_get_cur_index() == OTA_INDEX_1) {
180+
if (getOTACurAddr() == OTA_INDEX_1) {
156181
ota_target_index = OTA_INDEX_2;
157182
} else {
158183
ota_target_index = OTA_INDEX_1;

Arduino_package/hardware/libraries/OTA/src/OTA.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class OTA {
1616
OTA(void);
1717
~OTA(void);
1818

19+
uint32_t getOTACurAddr(void);
1920
// Starts to connect to OTA server and receive the new firmware
2021
// To begin OTA firmware update process via MDNS
2122
void beginOTA(int port);

0 commit comments

Comments
 (0)