-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* -- * test * ota * ameba1/rtl8711am * workflow build * uart tcp bridge driver * fix build * Static ip fix * fix * Rework amebaz ota --------- Co-authored-by: Tester23 <[email protected]>
- Loading branch information
1 parent
017929d
commit 6ac1f26
Showing
59 changed files
with
7,832 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
* text=auto | ||
|
||
*.S text | ||
*.asm text | ||
*.c text | ||
*.cc text | ||
*.cpp text | ||
*.cxx text | ||
*.h text | ||
*.htm text | ||
*.html text | ||
*.in text | ||
*.ld text | ||
*.m4 text | ||
*.mak text | ||
*.mk text | ||
*.py text | ||
*.rb text | ||
*.s text | ||
*.sct text | ||
*.sh text | ||
*.txt text | ||
*.xml text | ||
Makefile text | ||
AUTHORS text | ||
COPYING text | ||
|
||
*.LZO -text | ||
*.Opt -text | ||
*.Uv2 -text | ||
*.ewp -text | ||
*.eww -text | ||
*.vcproj -text | ||
*.bat -text | ||
*.dos -text | ||
*.icf -text | ||
*.inf -text | ||
*.ini -text | ||
*.sct -text | ||
*.xsd -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2014-2020 Armink ([email protected]) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
'Software'), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
/* | ||
* This file is part of the EasyFlash Library. | ||
* | ||
* Copyright (c) 2014-2019, Armink, <[email protected]> | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining | ||
* a copy of this software and associated documentation files (the | ||
* 'Software'), to deal in the Software without restriction, including | ||
* without limitation the rights to use, copy, modify, merge, publish, | ||
* distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to | ||
* the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be | ||
* included in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
* | ||
* Function: It is an head file for this library. You can see all be called functions. | ||
* Created on: 2014-09-10 | ||
*/ | ||
|
||
|
||
#ifndef EASYFLASH_H_ | ||
#define EASYFLASH_H_ | ||
|
||
#include <stdint.h> | ||
#include <stddef.h> | ||
#include <stdbool.h> | ||
#include <ef_cfg.h> | ||
#include <ef_def.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* easyflash.c */ | ||
EfErrCode easyflash_init(void); | ||
|
||
#ifdef EF_USING_ENV | ||
/* only supported on ef_env.c */ | ||
size_t ef_get_env_blob(const char *key, void *value_buf, size_t buf_len, size_t *saved_value_len); | ||
bool ef_get_env_obj(const char *key, env_node_obj_t env); | ||
size_t ef_read_env_value(env_node_obj_t env, uint8_t *value_buf, size_t buf_len); | ||
EfErrCode ef_set_env_blob(const char *key, const void *value_buf, size_t buf_len); | ||
|
||
/* ef_env.c, ef_env_legacy_wl.c and ef_env_legacy.c */ | ||
EfErrCode ef_load_env(void); | ||
void ef_print_env(void); | ||
char *ef_get_env(const char *key); | ||
EfErrCode ef_set_env(const char *key, const char *value); | ||
EfErrCode ef_del_env(const char *key); | ||
EfErrCode ef_save_env(void); | ||
EfErrCode ef_env_set_default(void); | ||
size_t ef_get_env_write_bytes(void); | ||
EfErrCode ef_set_and_save_env(const char *key, const char *value); | ||
EfErrCode ef_del_and_save_env(const char *key); | ||
#endif | ||
|
||
#ifdef EF_USING_IAP | ||
/* ef_iap.c */ | ||
EfErrCode ef_erase_bak_app(size_t app_size); | ||
EfErrCode ef_erase_user_app(uint32_t user_app_addr, size_t user_app_size); | ||
EfErrCode ef_erase_spec_user_app(uint32_t user_app_addr, size_t app_size, | ||
EfErrCode (*app_erase)(uint32_t addr, size_t size)); | ||
EfErrCode ef_erase_bl(uint32_t bl_addr, size_t bl_size); | ||
EfErrCode ef_write_data_to_bak(uint8_t *data, size_t size, size_t *cur_size, | ||
size_t total_size); | ||
EfErrCode ef_copy_app_from_bak(uint32_t user_app_addr, size_t app_size); | ||
EfErrCode ef_copy_spec_app_from_bak(uint32_t user_app_addr, size_t app_size, | ||
EfErrCode (*app_write)(uint32_t addr, const uint32_t *buf, size_t size)); | ||
EfErrCode ef_copy_bl_from_bak(uint32_t bl_addr, size_t bl_size); | ||
uint32_t ef_get_bak_app_start_addr(void); | ||
#endif | ||
|
||
#ifdef EF_USING_LOG | ||
/* ef_log.c */ | ||
EfErrCode ef_log_read(size_t index, uint32_t *log, size_t size); | ||
EfErrCode ef_log_write(const uint32_t *log, size_t size); | ||
EfErrCode ef_log_clean(void); | ||
size_t ef_log_get_used_size(void); | ||
#endif | ||
|
||
/* ef_utils.c */ | ||
uint32_t ef_calc_crc32(uint32_t crc, const void *buf, size_t size); | ||
|
||
/* ef_port.c */ | ||
EfErrCode ef_port_read(uint32_t addr, uint32_t *buf, size_t size); | ||
EfErrCode ef_port_erase(uint32_t addr, size_t size); | ||
EfErrCode ef_port_write(uint32_t addr, const uint32_t *buf, size_t size); | ||
void ef_port_env_lock(void); | ||
void ef_port_env_unlock(void); | ||
void ef_log_debug(const char *file, const long line, const char *format, ...); | ||
void ef_log_info(const char *format, ...); | ||
void ef_print(const char *format, ...); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* EASYFLASH_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
/* | ||
* This file is part of the EasyFlash Library. | ||
* | ||
* Copyright (c) 2015-2019, Armink, <[email protected]> | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining | ||
* a copy of this software and associated documentation files (the | ||
* 'Software'), to deal in the Software without restriction, including | ||
* without limitation the rights to use, copy, modify, merge, publish, | ||
* distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to | ||
* the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be | ||
* included in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
* | ||
* Function: It is the configure head file for this library. | ||
* Created on: 2015-07-14 | ||
*/ | ||
|
||
|
||
#ifndef EF_CFG_H_ | ||
#define EF_CFG_H_ | ||
|
||
#define PKG_EASYFLASH_ENV | ||
|
||
/* using ENV function */ | ||
#ifdef PKG_EASYFLASH_ENV | ||
#define EF_USING_ENV | ||
|
||
#ifdef PKG_EASYFLASH_ENV_AUTO_UPDATE | ||
/* Auto update ENV to latest default when current ENV version number is changed. */ | ||
#define EF_ENV_AUTO_UPDATE | ||
/** | ||
* ENV version number defined by user. | ||
* Please change it when your firmware add a new ENV to default_env_set. | ||
*/ | ||
#define EF_ENV_VER_NUM PKG_EASYFLASH_ENV_VER_NUM | ||
#endif | ||
|
||
#endif /* PKG_EASYFLASH_ENV */ | ||
|
||
/* using IAP function */ | ||
#ifdef PKG_EASYFLASH_IAP | ||
#define EF_USING_IAP | ||
#endif | ||
|
||
/* using save log function */ | ||
#ifdef PKG_EASYFLASH_LOG | ||
#define EF_USING_LOG | ||
/* saved log area size */ | ||
#define LOG_AREA_SIZE (PKG_EASYFLASH_LOG_AREA_SIZE) | ||
#endif | ||
|
||
/* the minimum size of flash erasure */ | ||
#define EF_ERASE_MIN_SIZE 4096 | ||
|
||
/* the flash write granularity, unit: bit | ||
* only support 1(nor flash)/ 8(stm32f4)/ 32(stm32f1)/ 64(stm32l4) */ | ||
#define EF_WRITE_GRAN 1 | ||
|
||
/* | ||
* | ||
* This all Backup Area Flash storage index. All used flash area configure is under here. | ||
* |----------------------------| Storage Size | ||
* | Environment variables area | ENV area size @see ENV_AREA_SIZE | ||
* |----------------------------| | ||
* | Saved log area | Log area size @see LOG_AREA_SIZE | ||
* |----------------------------| | ||
* |(IAP)Downloaded application | IAP already downloaded application, unfixed size | ||
* |----------------------------| | ||
* | ||
* @note all area sizes must be aligned with EF_ERASE_MIN_SIZE | ||
* | ||
* The EasyFlash add the NG (Next Generation) mode start from V4.0. All old mode before V4.0, called LEGACY mode. | ||
* | ||
* - NG (Next Generation) mode is default mode from V4.0. It's easy to settings, only defined the ENV_AREA_SIZE. | ||
* - The LEGACY mode has been DEPRECATED. It is NOT RECOMMENDED to continue using. | ||
* Beacuse it will use ram to buffer the ENV and spend more flash erase times. | ||
* If you want use it please using the V3.X version. | ||
*/ | ||
|
||
#ifdef PLATFORM_RTL87X0C | ||
|
||
/* backup area start address */ | ||
#define EF_START_ADDR 0x1F0000 | ||
|
||
/* ENV area size. It's at least one empty sector for GC. So it's definition must more then or equal 2 flash sector size. */ | ||
#define ENV_AREA_SIZE 0x10000 /* default is the double erase min size */ | ||
|
||
#elif PLATFORM_RTL8710B | ||
|
||
#define EF_START_ADDR 0x195000 | ||
#define ENV_AREA_SIZE 0x8000 | ||
|
||
#elif PLATFORM_RTL8710A | ||
|
||
#define EF_START_ADDR 0x2E3000 | ||
#define ENV_AREA_SIZE 0x1C000 | ||
|
||
#endif | ||
/* print debug information of flash */ | ||
#ifdef PKG_EASYFLASH_DEBUG | ||
#define PRINT_DEBUG | ||
#endif | ||
|
||
#endif /* EF_CFG_H_ */ |
Oops, something went wrong.