提交 875a14aa 编写于 作者: S supowang

add EVB_LN822x iot exporer demo

add EVB_LN822x  iot exporer demo
上级 c90e31d9
#ifndef __SERIAL_P_H__
#define __SERIAL_P_H__
#ifndef __SERIAL_HW_H__
#define __SERIAL_HW_H__
#include "hal/hal_uart.h"
......@@ -37,4 +37,4 @@ struct SerialHardware *serial_hw_getdesc(SerialPortID port_id);
#endif /* __SERIAL_P_H__ */
#endif /* __SERIAL_HW_H__ */
#include "hal/hal_adc.h"
#include "drv/drv_adc_measure.h"
#include "drv_adc_measure.h"
void drv_adc_init(void)
{
......
......@@ -8,7 +8,7 @@
#include "netif/ethernetif.h"
#include "wifi_manager/wifi_manager.h"
#include "lwip/tcpip.h"
#include "drv/drv_adc_measure.h"
#include "drv_adc_measure.h"
#include "utils/system_parameter.h"
#include "hal/hal_adc.h"
......@@ -161,7 +161,7 @@ void application_entry(void *arg)
ART_ASSERT(1);
}
reg_wifi_msg_callbcak(wifi_manager_get_handle(), WIFI_MSG_ID_STA_DHCP_GOT_IP,wifi_event_sta_got_ip_cb);
reg_wifi_msg_callbcak(WIFI_MSG_ID_STA_DHCP_GOT_IP,wifi_event_sta_got_ip_cb);
wifi_mode_enum_t wifi_mode = WIFI_MODE_STATION;
......
......@@ -2,7 +2,7 @@
#include "cmsis_os.h"
#include "osal/osal.h"
#define APPLICATION_TASK_STK_SIZE 6*256
#define APPLICATION_TASK_STK_SIZE (8*1024)
extern void application_entry(void *arg);
osThreadDef(application_entry, osPriorityLow, 1, APPLICATION_TASK_STK_SIZE);//osPriorityNormal
......@@ -17,7 +17,9 @@ __weak void application_entry(void *arg)
#include "wifi_manager/wifi_manager.h"
#include "utils/system_parameter.h"
#include "atcmd/at_task.h"
#include "ln_kv_port.h"
#include "ln_kv_api.h"
#include "flash_partition_table.h"
int main(void)
{
......@@ -28,10 +30,13 @@ int main(void)
at_init();
system_parameter_init();
if (KV_ERR_NONE != ln_kv_port_init(KV_SPACE_OFFSET, (KV_SPACE_OFFSET + KV_SPACE_SIZE))) {
LOG(LOG_LVL_ERROR, "KV init filed!\r\n");
}
wifi_init();
lwip_tcpip_init();
wifi_manager_init(wifi_manager_get_handle());
wifi_manager_init();
osThreadCreate(osThread(application_entry), NULL); // Create TOS Tiny task
osKernelStart(); // Start TOS Tiny
......
......@@ -29,29 +29,6 @@ int fgetc(FILE *f)
return ch;
}
//int flash_write(uint32_t addr, const void *buf, size_t len){
// FLASH_Program(addr,len, (uint8_t *)buf);
//}
//int flash_read(uint32_t addr, void *buf, size_t len){
// FLASH_ReadByCache(addr, len, (uint8_t *)buf);
//}
//void nvds_kv_init(void)
//{
// kv_flash_drv_t flash_drv;
// kv_flash_prop_t flash_prop;
//
// flash_drv.write = flash_write;
// flash_drv.read = flash_read;
// flash_drv.erase = FLASH_Erase;
//
// flash_prop.sector_size_log2 = 8;
// flash_prop.pgm_type = KV_FLASH_PROGRAM_TYPE_BYTE;
// flash_prop.flash_start = SYSTEM_PARAMETER_OFFSET;
// flash_prop.flash_size = SIZE_4KB*2;
//}
void board_init(void)
{
SetSysClock();
......@@ -64,8 +41,6 @@ void board_init(void)
log_init();//init log serial
cm_backtrace_init("wifi app", "HD_V2", "SW_V0.8");
// nvds_kv_init();
}
......
......@@ -8,7 +8,7 @@
#include "netif/ethernetif.h"
#include "wifi_manager/wifi_manager.h"
#include "lwip/tcpip.h"
#include "drv/drv_adc_measure.h"
#include "drv_adc_measure.h"
#include "utils/system_parameter.h"
#include "hal/hal_adc.h"
......@@ -161,7 +161,7 @@ void application_entry(void *arg)
ART_ASSERT(1);
}
reg_wifi_msg_callbcak(wifi_manager_get_handle(), WIFI_MSG_ID_STA_DHCP_GOT_IP,wifi_event_sta_got_ip_cb);
reg_wifi_msg_callbcak(WIFI_MSG_ID_STA_DHCP_GOT_IP,wifi_event_sta_got_ip_cb);
wifi_mode_enum_t wifi_mode = WIFI_MODE_STATION;
......
......@@ -4,6 +4,7 @@
#include "serial/serial.h"
#include "hal/hal_syscon.h"
#include "hal/hal_uart.h"
//#include "hal/hal_sleep.h"
#include "utils/debug/art_assert.h"
#define UART0_TX_BUF_SIZE CFG_UART0_TX_BUF_SIZE
......@@ -158,6 +159,10 @@ static void hw_uart0_init(struct SerialHardware *_hw, struct Serial *serial, uin
//enable uart master switch
NVIC_EnableIRQ(UART0_IRQn);
/*
* Register with the sleep module to ensure that the serial port can be used during Light sleep
*/
// hal_sleep_register(MOD_UART0, NULL, NULL, NULL);
}
static void hw_uart1_init(struct SerialHardware *_hw, struct Serial *serial, uint32_t baudrate)
......@@ -192,6 +197,11 @@ static void hw_uart1_init(struct SerialHardware *_hw, struct Serial *serial, uin
//enable uart master switch
NVIC_EnableIRQ(UART1_IRQn);
/*
* Register with the sleep module to ensure that the serial port can be used during Light sleep
*/
// hal_sleep_register(MOD_UART1, NULL, NULL, NULL);
}
/*
......
......@@ -10,8 +10,7 @@
<TargetName>TencentOS_tiny</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<uAC6>0</uAC6>
<pCCUsed>5060061::V5.06 update 1 (build 61)::ARMCC</pCCUsed>
<TargetOption>
<TargetCommonOption>
<Device>ARMCM4_FP</Device>
......@@ -70,9 +69,9 @@
<nStopU2X>0</nStopU2X>
</BeforeCompile>
<BeforeMake>
<RunUserProg1>0</RunUserProg1>
<RunUserProg1>1</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name></UserProg1Name>
<UserProg1Name>python ..\..\..\..\platform\vendor_bsp\LN\ln882x\tools\user_cmd\before_build.py flash_partition_cfg.json flash_partition_table.h</UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
......@@ -81,9 +80,9 @@
</BeforeMake>
<AfterMake>
<RunUserProg1>1</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name>.\after_build_ln882x.bat</UserProg1Name>
<UserProg2Name></UserProg2Name>
<RunUserProg2>1</RunUserProg2>
<UserProg1Name>python ..\..\..\..\platform\vendor_bsp\LN\ln882x\tools\user_cmd\after_build_soc.py @L</UserProg1Name>
<UserProg2Name>..\..\..\..\platform\vendor_bsp\LN\ln882x\tools\bin\mkimage.exe cmd_app ..\..\..\..\platform\vendor_bsp\LN\ln882x\lib\boot_ln882x.bin @L.bin @L.asm flashimage.bin flash_partition_cfg.json ver=1.1</UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopA1X>0</nStopA1X>
......@@ -184,7 +183,6 @@
<hadXRAM>0</hadXRAM>
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
......@@ -325,20 +323,16 @@
<uThumb>0</uThumb>
<uSurpInc>0</uSurpInc>
<uC99>1</uC99>
<uGnu>0</uGnu>
<useXO>0</useXO>
<v6Lang>1</v6Lang>
<v6LangP>1</v6LangP>
<vShortEn>1</vShortEn>
<vShortWch>1</vShortWch>
<v6Lto>0</v6Lto>
<v6WtE>0</v6WtE>
<v6Rtti>0</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define>LN882x,ARM_MATH_CM4</Define>
<Undefine></Undefine>
<IncludePath>..\..\BSP\Inc;..\..\TOS-CONFIG;..\..\..\..\kernel\pm\include;..\..\..\..\kernel\core\include;..\..\..\..\arch\arm\arm-v7m\common\include;..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc;..\..\..\..\osal\cmsis_os;..\..\..\..\examples\helloworld;..\hello_world;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\driver_ln882x;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\driver_ln882x\ll\include;..\..\..\..\components\fs\kv\include;..\..\..\..\platform\vendor_bsp\LN\ln882x\include;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\cpu\ARM_CM4F\ln88xx;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\kernel;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\cpu\ARM_CM4F\CMSIS_5.3.0;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\wifi_manager;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\net;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\net\lwip-2.0.3\src\include;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\net\lwip-2.0.3\src\port;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\net\lwip-2.0.3\src\port\arch;..\..\..\..\components\connectivity\mqttclient\common;..\..\..\..\components\connectivity\mqttclient\mqtt;..\..\..\..\components\connectivity\mqttclient\mqttclient;..\..\..\..\components\connectivity\mqttclient\network;..\..\..\..\components\connectivity\mqttclient\platform\TencentOS-tiny</IncludePath>
<IncludePath>..\..\BSP\Inc;..\..\TOS-CONFIG;..\..\..\..\kernel\pm\include;..\..\..\..\kernel\core\include;..\..\..\..\arch\arm\arm-v7m\common\include;..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc;..\..\..\..\osal\cmsis_os;..\..\..\..\examples\helloworld;..\hello_world;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\driver_ln882x;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\driver_ln882x\ll\include;..\..\..\..\components\fs\kv\include;..\..\..\..\platform\vendor_bsp\LN\ln882x\include;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\cpu\ARM_CM4F\ln88xx;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\kernel;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\cpu\ARM_CM4F\CMSIS_5.3.0;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\wifi_manager;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\net;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\net\lwip-2.0.3\src\include;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\net\lwip-2.0.3\src\port;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\net\lwip-2.0.3\src\port\arch;..\..\..\..\components\connectivity\mqttclient\common;..\..\..\..\components\connectivity\mqttclient\mqtt;..\..\..\..\components\connectivity\mqttclient\mqttclient;..\..\..\..\components\connectivity\mqttclient\network;..\..\..\..\components\connectivity\mqttclient\platform\TencentOS-tiny;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\wifi\wifi_port;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\fs\kv\kv_port;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\fs\kv\kv;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\fs\nvds;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\fs\partition_mgr;..\mqtt_client</IncludePath>
</VariousControls>
</Cads>
<Aads>
......@@ -351,7 +345,6 @@
<NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
......@@ -369,10 +362,10 @@
<TextAddressRange>0x08000000</TextAddressRange>
<DataAddressRange>0x20000000</DataAddressRange>
<pXoBase></pXoBase>
<ScatterFile>.\firmware_XIP_ln882x.sct</ScatterFile>
<ScatterFile>.\ln882x.sct</ScatterFile>
<IncludeLibs></IncludeLibs>
<IncludeLibsPath></IncludeLibsPath>
<Misc>--no_autoat --keep=main.o(no_init_data)</Misc>
<Misc>--no_autoat --keep=*.o(no_init_data)</Misc>
<LinkerInputFile></LinkerInputFile>
<DisabledWarnings></DisabledWarnings>
</LDads>
......@@ -419,16 +412,6 @@
</File>
</Files>
</Group>
<Group>
<GroupName>Drivers/Drv</GroupName>
<Files>
<File>
<FileName>drv_adc_measure.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\src\driver_ln882x\drv\drv_adc_measure.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>Drivers/HAL</GroupName>
<Files>
......@@ -514,15 +497,11 @@
<uThumb>2</uThumb>
<uSurpInc>2</uSurpInc>
<uC99>2</uC99>
<uGnu>2</uGnu>
<useXO>2</useXO>
<v6Lang>0</v6Lang>
<v6LangP>0</v6LangP>
<vShortEn>2</vShortEn>
<vShortWch>2</vShortWch>
<v6Lto>2</v6Lto>
<v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
......@@ -728,6 +707,16 @@
<FileType>1</FileType>
<FilePath>..\..\BSP\Src\mcu_init.c</FilePath>
</File>
<File>
<FileName>serial_hw.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\BSP\Src\serial_hw.c</FilePath>
</File>
<File>
<FileName>drv_adc_measure.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\BSP\Src\drv_adc_measure.c</FilePath>
</File>
</Files>
</Group>
<Group>
......@@ -738,11 +727,6 @@
<FileType>1</FileType>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\src\serial\serial.c</FilePath>
</File>
<File>
<FileName>serial_hw.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\src\serial\serial_hw.c</FilePath>
</File>
</Files>
</Group>
<Group>
......@@ -924,9 +908,9 @@
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\lib\wifi_mac.lib</FilePath>
</File>
<File>
<FileName>wifi_driver.lib</FileName>
<FileName>soc_driver.lib</FileName>
<FileType>4</FileType>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\lib\wifi_driver.lib</FilePath>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\lib\soc_driver.lib</FilePath>
</File>
</Files>
</Group>
......@@ -938,6 +922,11 @@
<FileType>1</FileType>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\src\wifi\wifi_manager\wifi_manager.c</FilePath>
</File>
<File>
<FileName>wifi_port.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\src\wifi\wifi_port\wifi_port.c</FilePath>
</File>
</Files>
</Group>
<Group>
......@@ -1005,15 +994,11 @@
<uThumb>2</uThumb>
<uSurpInc>2</uSurpInc>
<uC99>2</uC99>
<uGnu>2</uGnu>
<useXO>2</useXO>
<v6Lang>0</v6Lang>
<v6LangP>0</v6LangP>
<vShortEn>2</vShortEn>
<vShortWch>2</vShortWch>
<v6Lto>2</v6Lto>
<v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
......@@ -1232,22 +1217,27 @@
</Files>
</Group>
<Group>
<GroupName>tos_components</GroupName>
<GroupName>fs</GroupName>
<Files>
<File>
<FileName>tos_kv.c</FileName>
<FileName>ln_kv.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\components\fs\kv\tos_kv.c</FilePath>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\src\fs\kv\kv\ln_kv.c</FilePath>
</File>
<File>
<FileName>ln_kv_port.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\src\fs\kv\kv_port\ln_kv_port.c</FilePath>
</File>
<File>
<FileName>flash_partition_mgr.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\src\fs\partition_mgr\flash_partition_mgr.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>nvds</GroupName>
<Files>
<File>
<FileName>nvds.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\src\nvds\nvds.c</FilePath>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\src\fs\nvds\nvds.c</FilePath>
</File>
</Files>
</Group>
......
python ..\..\..\..\platform\vendor_bsp\LN\ln882x\tools\user_cmd\after_build_soc.py firmware_XIP
..\..\..\..\platform\vendor_bsp\LN\ln882x\tools\bin\mkimage.exe ln882x flashimage ..\..\..\..\platform\vendor_bsp\LN\ln882x\lib\boot_ram_ln882x.bin firmware_XIP.bin flashimage.bin release=1 crp_enable=0 app_version=10 hw_version=0
..\..\..\..\platform\vendor_bsp\LN\ln882x\tools\bin\fpu_patch.exe .\firmware_XIP.asm .\flashimage.bin
python ..\..\..\..\platform\vendor_bsp\LN\ln882x\tools\user_cmd\after_build_soc.py @L
..\..\..\..\platform\vendor_bsp\LN\ln882x\tools\bin\mkimage.exe cmd_app ..\..\..\..\platform\vendor_bsp\LN\ln882x\lib\boot_ln882x.bin @L.bin @L.asm flashimage.bin flash_partition_cfg.json ver=1.1
{
"Warning1":"警告,系统定义用户不可修改!!!",
"vendor_define":
[
{"partition_type": "BOOT", "start_addr": "0x00000000", "size_KB": 36 },
{"partition_type": "PART_TAB", "start_addr": "0x00009000", "size_KB": 4 }
],
"Warning2":"以下数据,用户根据SOC flash容量以及具体需求修改,仅可以修改start_addr值和size值,且必须4KB对齐!!!",
"user_define":
[
{"partition_type": "KV", "start_addr": "0x0000A000", "size_KB": 8 },
{"partition_type": "SIMU_EEPROM", "start_addr": "0x0000C000", "size_KB": 8 },
{"partition_type": "APP", "start_addr": "0x0000E000", "size_KB": 800 },
{"partition_type": "OTA", "start_addr": "0x000D6000", "size_KB": 800 },
{"partition_type": "NVDS", "start_addr": "0x0019E000", "size_KB": 12 },
{"partition_type": "USER", "start_addr": "0x001A1000", "size_KB": 12 }
]
}
#ifndef __FLASH_PARTITION_TABLE_H__
#define __FLASH_PARTITION_TABLE_H__
#ifndef __FLASH_PARTITION_TABLE__
#define __FLASH_PARTITION_TABLE__
//#define RETENTION_MEM_BASE 0x20028000
//#define RETENTION_MEM_SIZE 0x2000
#ifndef FLASH_BASE
#define FLASH_BASE (0x10000000)
//flash partition map,it's generated by the script based on the json file <flash_partition_table.json>
#define BOOT_SPACE_OFFSET (0x00000000)
#define BOOT_SPACE_SIZE (1024*36)
#define PART_TAB_SPACE_OFFSET (0x00009000)
#define PART_TAB_SPACE_SIZE (1024*4)
#if (PART_TAB_SPACE_OFFSET < (BOOT_SPACE_OFFSET + BOOT_SPACE_SIZE))
#error "flash partition overlap,please check <flash_partition_table.json>!!!"
#endif
#define KV_SPACE_OFFSET (0x0000A000)
#define KV_SPACE_SIZE (1024*8)
#if (KV_SPACE_OFFSET < (PART_TAB_SPACE_OFFSET + PART_TAB_SPACE_SIZE))
#error "flash partition overlap,please check <flash_partition_table.json>!!!"
#endif
#define SIMU_EEPROM_SPACE_OFFSET (0x0000C000)
#define SIMU_EEPROM_SPACE_SIZE (1024*8)
#if (SIMU_EEPROM_SPACE_OFFSET < (KV_SPACE_OFFSET + KV_SPACE_SIZE))
#error "flash partition overlap,please check <flash_partition_table.json>!!!"
#endif
#ifndef FLASH_SIZE
#define FLASH_SIZE (0x00200000)
#define APP_SPACE_OFFSET (0x0000E000)
#define APP_SPACE_SIZE (1024*800)
#if (APP_SPACE_OFFSET < (SIMU_EEPROM_SPACE_OFFSET + SIMU_EEPROM_SPACE_SIZE))
#error "flash partition overlap,please check <flash_partition_table.json>!!!"
#endif
#ifndef PRIMARY_PARTITION_OFFSET
#define PRIMARY_PARTITION_OFFSET (0x0000F000)
#define OTA_SPACE_OFFSET (0x000D6000)
#define OTA_SPACE_SIZE (1024*800)
#if (OTA_SPACE_OFFSET < (APP_SPACE_OFFSET + APP_SPACE_SIZE))
#error "flash partition overlap,please check <flash_partition_table.json>!!!"
#endif
#define PRIMARY_PATTITION_START 0x0000F000
#define PRIMARY_PATTITION_SIZE 0xE1000
//#define USERAPP_SRAM_BASE 0x1FFF0000
#define BACKUP_PATTITION_START 0x000F0000
#define BACKUP_PATTITION_SIZE 0xE1000
#define USERDATA_PATTITION_START 0x001D1000
#define USERDATA_PATTITION_SIZE 0x23000
//memory offset check
#if ((PRIMARY_PATTITION_START < PRIMARY_PARTITION_OFFSET) || (BACKUP_PATTITION_START < PRIMARY_PATTITION_START) || (USERDATA_PATTITION_START < BACKUP_PATTITION_START) || (PRIMARY_PATTITION_START + PRIMARY_PATTITION_SIZE > BACKUP_PATTITION_START) || (BACKUP_PATTITION_START + BACKUP_PATTITION_SIZE > USERDATA_PATTITION_START) || (USERDATA_PATTITION_START + USERDATA_PATTITION_SIZE > FLASH_SIZE))
#error "flash partition define error!"
#define NVDS_SPACE_OFFSET (0x0019E000)
#define NVDS_SPACE_SIZE (1024*12)
#if (NVDS_SPACE_OFFSET < (OTA_SPACE_OFFSET + OTA_SPACE_SIZE))
#error "flash partition overlap,please check <flash_partition_table.json>!!!"
#endif
#endif /* __FLASH_PARTITION_TABLE_H__ */
#define USER_SPACE_OFFSET (0x001A1000)
#define USER_SPACE_SIZE (1024*12)
#if (USER_SPACE_OFFSET < (NVDS_SPACE_OFFSET + NVDS_SPACE_SIZE))
#error "flash partition overlap,please check <flash_partition_table.json>!!!"
#endif
#define IMAGE_HEADER_SIZE (0x100)
#endif /* __FLASH_PARTITION_TABLE__ */
#! armcc -E
#include ".\flash_partition_table.h"
#include "flash_partition_table.h"
#include ".\..\..\..\..\platform\vendor_bsp\LN\ln882x\include\cpu\ARM_CM4F\ln88xx\mem_map_ln882x.h"
LR_FLASH FLASH_BASE+PRIMARY_PARTITION_OFFSET PRIMARY_PATTITION_SIZE
LR_FLASH CACHE_FLASH_BASE+APP_SPACE_OFFSET+IMAGE_HEADER_SIZE APP_SPACE_SIZE
{; load region size_region
ISR_VECTOR RAM_BASE ALIGN 0x100
......@@ -11,7 +11,7 @@ LR_FLASH FLASH_BASE+PRIMARY_PARTITION_OFFSET PRIMARY_PATTITION_SIZE
startup_*.o (RESET, +First)
}
ER_FLASH FLASH_BASE+PRIMARY_PARTITION_OFFSET + ImageLength(ISR_VECTOR) PRIMARY_PATTITION_SIZE
ER_FLASH CACHE_FLASH_BASE+APP_SPACE_OFFSET+IMAGE_HEADER_SIZE + ImageLength(ISR_VECTOR) APP_SPACE_SIZE
{; load address = execution address
*(InRoot$$Sections)
.ANY (+RO)
......@@ -24,15 +24,15 @@ LR_FLASH FLASH_BASE+PRIMARY_PARTITION_OFFSET PRIMARY_PATTITION_SIZE
ll_cache.o(+RO)
ll_dma.o(+RO)
ll_syscon.o(+RO)
ll_sleep.o(+RO)
ll_rtc.o(+RO)
;ll_sleep.o(+RO)
;ll_rtc.o(+RO)
cache.o(+RO)
qspi.o(+RO)
flash.o(+RO)
hal_dma.o(+RO)
hal_syscon.o(+RO)
hal_sleep.o(+RO)
hal_rtc.o(+RO)
;hal_sleep.o(+RO)
;hal_rtc.o(+RO)
;port.o(XIR)
;optional item
......@@ -49,16 +49,32 @@ LR_FLASH FLASH_BASE+PRIMARY_PARTITION_OFFSET PRIMARY_PATTITION_SIZE
startup_ln*(+RW +ZI)
}
ER_DATA +0
ER_DATA_IN_B0 +0 RAM_BLOCK0_SIZE-ImageLength(ISR_VECTOR)-ImageLength(ER_CODE)-ImageLength(ER_STACK)
{
*(.ARM.__at_0x1FFFFFFC)
.ANY (+RW +ZI)
memp.o(+RW +ZI)
imem.o(+RW +ZI)
imem_if.o(+RW +ZI)
;cglobals_sta.o(+RW +ZI)
;event_manager.o(+RW +ZI)
iconfig.o(+RW +ZI)
common.o(+RW +ZI)
}
HEAP_SPACE0 +0 EMPTY RAM_BLOCK1_BASE-ImageLimit(ER_DATA_IN_B0)
{; Heap region
}
ER_DATA_IN_B1 RAM_BLOCK1_BASE RAM_BLOCK1_SIZE
{
*(wlan_mem_pkt)
*(wlan_mem_dscr)
.ANY (+RW +ZI)
}
;IQ Data area cannot be used by ER_DATA region
;ScatterAssert(ImageLimit(ER_DATA) < (0x20020300))
HEAP_SPACE +0 EMPTY RETENTION_MEM_BASE-ImageLimit(ER_DATA)
HEAP_SPACE1 +0 EMPTY RETENTION_MEM_BASE-ImageLimit(ER_DATA_IN_B1)
{; Heap region
}
......
......@@ -70,9 +70,9 @@
<nStopU2X>0</nStopU2X>
</BeforeCompile>
<BeforeMake>
<RunUserProg1>0</RunUserProg1>
<RunUserProg1>1</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name></UserProg1Name>
<UserProg1Name>python ..\..\..\..\platform\vendor_bsp\LN\ln882x\tools\user_cmd\before_build.py flash_partition_cfg.json flash_partition_table.h</UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
......@@ -81,9 +81,9 @@
</BeforeMake>
<AfterMake>
<RunUserProg1>1</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name>.\after_build_ln882x.bat</UserProg1Name>
<UserProg2Name></UserProg2Name>
<RunUserProg2>1</RunUserProg2>
<UserProg1Name>python ..\..\..\..\platform\vendor_bsp\LN\ln882x\tools\user_cmd\after_build_soc.py @L</UserProg1Name>
<UserProg2Name>..\..\..\..\platform\vendor_bsp\LN\ln882x\tools\bin\mkimage.exe cmd_app ..\..\..\..\platform\vendor_bsp\LN\ln882x\lib\boot_ln882x.bin @L.bin @L.asm flashimage.bin flash_partition_cfg.json ver=1.1</UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopA1X>0</nStopA1X>
......@@ -338,7 +338,7 @@
<MiscControls></MiscControls>
<Define>LN882x,ARM_MATH_CM4,MBEDTLS_CONFIG_FILE=&lt;qcloud/tls_psk_config.h&gt;</Define>
<Undefine></Undefine>
<IncludePath>..\..\BSP\Inc;..\..\TOS-CONFIG;..\..\..\..\kernel\pm\include;..\..\..\..\kernel\core\include;..\..\..\..\arch\arm\arm-v7m\common\include;..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc;..\..\..\..\osal\cmsis_os;..\..\..\..\examples\helloworld;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\driver_ln882x;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\driver_ln882x\ll\include;..\..\..\..\components\fs\kv\include;..\..\..\..\platform\vendor_bsp\LN\ln882x\include;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\cpu\ARM_CM4F\ln88xx;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\kernel;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\cpu\ARM_CM4F\CMSIS_5.3.0;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\wifi_manager;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\net;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\net\lwip-2.0.3\src\include;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\net\lwip-2.0.3\src\port;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\net\lwip-2.0.3\src\port\arch;..\..\..\..\components\connectivity\qcloud-iot-explorer-sdk\3rdparty\include;..\..\..\..\components\connectivity\qcloud-iot-explorer-sdk\3rdparty\include\exports;..\..\..\..\components\connectivity\qcloud-iot-explorer-sdk\3rdparty\sdk_src\internal_inc;..\..\..\..\components\security\mbedtls\3rdparty\include;..\..\..\..\components\security\mbedtls\wrapper\include</IncludePath>
<IncludePath>..\..\BSP\Inc;..\..\TOS-CONFIG;..\..\..\..\kernel\pm\include;..\..\..\..\kernel\core\include;..\..\..\..\arch\arm\arm-v7m\common\include;..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc;..\..\..\..\osal\cmsis_os;..\..\..\..\examples\helloworld;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\driver_ln882x;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\driver_ln882x\ll\include;..\..\..\..\components\fs\kv\include;..\..\..\..\platform\vendor_bsp\LN\ln882x\include;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\cpu\ARM_CM4F\ln88xx;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\kernel;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\cpu\ARM_CM4F\CMSIS_5.3.0;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\wifi_manager;..\..\..\..\platform\vendor_bsp\LN\ln882x\include\net;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\net\lwip-2.0.3\src\include;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\net\lwip-2.0.3\src\port;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\net\lwip-2.0.3\src\port\arch;..\..\..\..\components\connectivity\qcloud-iot-explorer-sdk\3rdparty\include;..\..\..\..\components\connectivity\qcloud-iot-explorer-sdk\3rdparty\include\exports;..\..\..\..\components\connectivity\qcloud-iot-explorer-sdk\3rdparty\sdk_src\internal_inc;..\..\..\..\components\security\mbedtls\3rdparty\include;..\..\..\..\components\security\mbedtls\wrapper\include;..\qcloud_iot_explorer;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\wifi\wifi_port;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\fs\kv\kv_port;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\fs\kv\kv;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\fs\nvds;..\..\..\..\platform\vendor_bsp\LN\ln882x\src\fs\partition_mgr</IncludePath>
</VariousControls>
</Cads>
<Aads>
......@@ -369,10 +369,10 @@
<TextAddressRange>0x08000000</TextAddressRange>
<DataAddressRange>0x20000000</DataAddressRange>
<pXoBase></pXoBase>
<ScatterFile>.\firmware_XIP_ln882x.sct</ScatterFile>
<ScatterFile>.\ln882x.sct</ScatterFile>
<IncludeLibs></IncludeLibs>
<IncludeLibsPath></IncludeLibsPath>
<Misc>--no_autoat --keep=main.o(no_init_data)</Misc>
<Misc>--no_autoat --keep=*.o(no_init_data)</Misc>
<LinkerInputFile></LinkerInputFile>
<DisabledWarnings></DisabledWarnings>
</LDads>
......@@ -429,16 +429,6 @@
</File>
</Files>
</Group>
<Group>
<GroupName>Drivers/Drv</GroupName>
<Files>
<File>
<FileName>drv_adc_measure.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\src\driver_ln882x\drv\drv_adc_measure.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>Drivers/HAL</GroupName>
<Files>
......@@ -738,6 +728,16 @@
<FileType>1</FileType>
<FilePath>..\..\BSP\Src\mcu_init.c</FilePath>
</File>
<File>
<FileName>serial_hw.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\BSP\Src\serial_hw.c</FilePath>
</File>
<File>
<FileName>drv_adc_measure.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\BSP\Src\drv_adc_measure.c</FilePath>
</File>
</Files>
</Group>
<Group>
......@@ -748,11 +748,6 @@
<FileType>1</FileType>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\src\serial\serial.c</FilePath>
</File>
<File>
<FileName>serial_hw.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\src\serial\serial_hw.c</FilePath>
</File>
</Files>
</Group>
<Group>
......@@ -934,9 +929,9 @@
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\lib\wifi_mac.lib</FilePath>
</File>
<File>
<FileName>wifi_driver.lib</FileName>
<FileName>soc_driver.lib</FileName>
<FileType>4</FileType>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\lib\wifi_driver.lib</FilePath>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\lib\soc_driver.lib</FilePath>
</File>
</Files>
</Group>
......@@ -948,6 +943,11 @@
<FileType>1</FileType>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\src\wifi\wifi_manager\wifi_manager.c</FilePath>
</File>
<File>
<FileName>wifi_port.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\src\wifi\wifi_port\wifi_port.c</FilePath>
</File>
</Files>
</Group>
<Group>
......@@ -1242,22 +1242,27 @@
</Files>
</Group>
<Group>
<GroupName>tos_components</GroupName>
<GroupName>fs</GroupName>
<Files>
<File>
<FileName>tos_kv.c</FileName>
<FileName>ln_kv.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\components\fs\kv\tos_kv.c</FilePath>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\src\fs\kv\kv\ln_kv.c</FilePath>
</File>
<File>
<FileName>ln_kv_port.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\src\fs\kv\kv_port\ln_kv_port.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>nvds</GroupName>
<Files>
<File>
<FileName>nvds.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\src\nvds\nvds.c</FilePath>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\src\fs\nvds\nvds.c</FilePath>
</File>
<File>
<FileName>flash_partition_mgr.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\platform\vendor_bsp\LN\ln882x\src\fs\partition_mgr\flash_partition_mgr.c</FilePath>
</File>
</Files>
</Group>
......
python ..\..\..\..\platform\vendor_bsp\LN\ln882x\tools\user_cmd\after_build_soc.py firmware_XIP
..\..\..\..\platform\vendor_bsp\LN\ln882x\tools\bin\mkimage.exe ln882x flashimage ..\..\..\..\platform\vendor_bsp\LN\ln882x\lib\boot_ram_ln882x.bin firmware_XIP.bin flashimage.bin release=1 crp_enable=0 app_version=10 hw_version=0
..\..\..\..\platform\vendor_bsp\LN\ln882x\tools\bin\fpu_patch.exe .\firmware_XIP.asm .\flashimage.bin
python ..\..\..\..\platform\vendor_bsp\LN\ln882x\tools\user_cmd\after_build_soc.py @L
..\..\..\..\platform\vendor_bsp\LN\ln882x\tools\bin\mkimage.exe cmd_app ..\..\..\..\platform\vendor_bsp\LN\ln882x\lib\boot_ln882x.bin @L.bin @L.asm flashimage.bin flash_partition_cfg.json ver=1.1
{
"Warning1":"警告,系统定义用户不可修改!!!",
"vendor_define":
[
{"partition_type": "BOOT", "start_addr": "0x00000000", "size_KB": 36 },
{"partition_type": "PART_TAB", "start_addr": "0x00009000", "size_KB": 4 }
],
"Warning2":"以下数据,用户根据SOC flash容量以及具体需求修改,仅可以修改start_addr值和size值,且必须4KB对齐!!!",
"user_define":
[
{"partition_type": "KV", "start_addr": "0x0000A000", "size_KB": 8 },
{"partition_type": "SIMU_EEPROM", "start_addr": "0x0000C000", "size_KB": 8 },
{"partition_type": "APP", "start_addr": "0x0000E000", "size_KB": 800 },
{"partition_type": "OTA", "start_addr": "0x000D6000", "size_KB": 800 },
{"partition_type": "NVDS", "start_addr": "0x0019E000", "size_KB": 12 },
{"partition_type": "USER", "start_addr": "0x001A1000", "size_KB": 12 }
]
}
#ifndef __FLASH_PARTITION_TABLE_H__
#define __FLASH_PARTITION_TABLE_H__
#ifndef __FLASH_PARTITION_TABLE__
#define __FLASH_PARTITION_TABLE__
//#define RETENTION_MEM_BASE 0x20028000
//#define RETENTION_MEM_SIZE 0x2000
#ifndef FLASH_BASE
#define FLASH_BASE (0x10000000)
//flash partition map,it's generated by the script based on the json file <flash_partition_table.json>
#define BOOT_SPACE_OFFSET (0x00000000)
#define BOOT_SPACE_SIZE (1024*36)
#define PART_TAB_SPACE_OFFSET (0x00009000)
#define PART_TAB_SPACE_SIZE (1024*4)
#if (PART_TAB_SPACE_OFFSET < (BOOT_SPACE_OFFSET + BOOT_SPACE_SIZE))
#error "flash partition overlap,please check <flash_partition_table.json>!!!"
#endif
#define KV_SPACE_OFFSET (0x0000A000)
#define KV_SPACE_SIZE (1024*8)
#if (KV_SPACE_OFFSET < (PART_TAB_SPACE_OFFSET + PART_TAB_SPACE_SIZE))
#error "flash partition overlap,please check <flash_partition_table.json>!!!"
#endif
#define SIMU_EEPROM_SPACE_OFFSET (0x0000C000)
#define SIMU_EEPROM_SPACE_SIZE (1024*8)
#if (SIMU_EEPROM_SPACE_OFFSET < (KV_SPACE_OFFSET + KV_SPACE_SIZE))
#error "flash partition overlap,please check <flash_partition_table.json>!!!"
#endif
#ifndef FLASH_SIZE
#define FLASH_SIZE (0x00200000)
#define APP_SPACE_OFFSET (0x0000E000)
#define APP_SPACE_SIZE (1024*800)
#if (APP_SPACE_OFFSET < (SIMU_EEPROM_SPACE_OFFSET + SIMU_EEPROM_SPACE_SIZE))
#error "flash partition overlap,please check <flash_partition_table.json>!!!"
#endif
#ifndef PRIMARY_PARTITION_OFFSET
#define PRIMARY_PARTITION_OFFSET (0x0000F000)
#define OTA_SPACE_OFFSET (0x000D6000)
#define OTA_SPACE_SIZE (1024*800)
#if (OTA_SPACE_OFFSET < (APP_SPACE_OFFSET + APP_SPACE_SIZE))
#error "flash partition overlap,please check <flash_partition_table.json>!!!"
#endif
#define PRIMARY_PATTITION_START 0x0000F000
#define PRIMARY_PATTITION_SIZE 0xE1000
//#define USERAPP_SRAM_BASE 0x1FFF0000
#define BACKUP_PATTITION_START 0x000F0000
#define BACKUP_PATTITION_SIZE 0xE1000
#define USERDATA_PATTITION_START 0x001D1000
#define USERDATA_PATTITION_SIZE 0x23000
//memory offset check
#if ((PRIMARY_PATTITION_START < PRIMARY_PARTITION_OFFSET) || (BACKUP_PATTITION_START < PRIMARY_PATTITION_START) || (USERDATA_PATTITION_START < BACKUP_PATTITION_START) || (PRIMARY_PATTITION_START + PRIMARY_PATTITION_SIZE > BACKUP_PATTITION_START) || (BACKUP_PATTITION_START + BACKUP_PATTITION_SIZE > USERDATA_PATTITION_START) || (USERDATA_PATTITION_START + USERDATA_PATTITION_SIZE > FLASH_SIZE))
#error "flash partition define error!"
#define NVDS_SPACE_OFFSET (0x0019E000)
#define NVDS_SPACE_SIZE (1024*12)
#if (NVDS_SPACE_OFFSET < (OTA_SPACE_OFFSET + OTA_SPACE_SIZE))
#error "flash partition overlap,please check <flash_partition_table.json>!!!"
#endif
#endif /* __FLASH_PARTITION_TABLE_H__ */
#define USER_SPACE_OFFSET (0x001A1000)
#define USER_SPACE_SIZE (1024*12)
#if (USER_SPACE_OFFSET < (NVDS_SPACE_OFFSET + NVDS_SPACE_SIZE))
#error "flash partition overlap,please check <flash_partition_table.json>!!!"
#endif
#define IMAGE_HEADER_SIZE (0x100)
#endif /* __FLASH_PARTITION_TABLE__ */
/Listings/
/Objects/
*.uvguix.*
JLinkLog.txt
*.bin
*.asm
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册