1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Get FirmwareIAP object working on revo

This commit is contained in:
James Cotton 2011-12-24 13:15:56 -06:00
parent 569b201b58
commit 05da41a79b
4 changed files with 27 additions and 3 deletions

View File

@ -32,7 +32,7 @@
#include "pios.h"
#if defined(PIOS_INCLUDE_BL_HELPER)
#include <pios_board_info.h>
#include "stm32f10x_flash.h"
#include "stm32f4xx_flash.h"
uint8_t *PIOS_BL_HELPER_FLASH_If_Read(uint32_t SectorAddress)
{
@ -97,6 +97,5 @@ void PIOS_BL_HELPER_FLASH_Read_Description(uint8_t * array, uint8_t size)
void PIOS_BL_HELPER_CRC_Ini()
{
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_CRC, ENABLE);
}
#endif

View File

@ -35,6 +35,8 @@
#if defined(PIOS_INCLUDE_SYS)
#define MEM8(addr) (*((volatile uint8_t *)(addr)))
/* Private Function Prototypes */
static void NVIC_Configuration(void);
@ -224,6 +226,27 @@ uint32_t PIOS_SYS_getCPUFlashSize(void)
return ((uint32_t) MEM_SIZE); // it might be possible to locate in the OTP area, but haven't looked and not documented
}
/**
* Returns the serial number as a string
* param[out] str pointer to a string which can store at least 32 digits + zero terminator!
* (24 digits returned for STM32)
* return < 0 if feature not supported
*/
int32_t PIOS_SYS_SerialNumberGetBinary(uint8_t *array)
{
int i;
/* Stored in the so called "electronic signature" */
for (i = 0; i < 12; ++i) {
uint8_t b = MEM8(0x1ffff7e8 + i);
array[i] = b;
}
/* No error */
return 0;
}
/**
* Returns the serial number as a string
* param[out] str pointer to a string which can store at least 32 digits + zero terminator!

View File

@ -115,6 +115,7 @@
657CEEBB121DBC63007A1FBE /* WorldMagModel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = WorldMagModel.c; sourceTree = "<group>"; };
657CF024121F49CD007A1FBE /* WMMInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMMInternal.h; sourceTree = "<group>"; };
657FF86A12EA8BFB00801617 /* pios_pwm_priv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_pwm_priv.h; sourceTree = "<group>"; };
6581785414A65B9B0007885F /* pios_bl_helper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pios_bl_helper.c; sourceTree = "<group>"; };
6589A972131DDE93006BD67C /* FreeRTOSConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FreeRTOSConfig.h; sourceTree = "<group>"; };
6589A983131DE24F006BD67C /* taskmonitor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = taskmonitor.c; sourceTree = "<group>"; };
6589A9DB131DEE76006BD67C /* pios_rtc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pios_rtc.c; sourceTree = "<group>"; };
@ -3901,6 +3902,7 @@
65904EC314613B6100FD9482 /* link_STM32F4xx_OP_memory.ld */,
65904EC414613B6100FD9482 /* link_STM32F4xx_sections.ld */,
65904EC514613B6100FD9482 /* pios_adc.c */,
6581785414A65B9B0007885F /* pios_bl_helper.c */,
65904EC614613B6100FD9482 /* pios_bma180.c */,
65904EC714613B6100FD9482 /* pios_bmp085.c */,
65904EC814613B6100FD9482 /* pios_debug.c */,

View File

@ -49,7 +49,7 @@ endif
FLASH_TOOL = OPENOCD
# List of modules to include
MODULES = Sensors Attitude/revolution ManualControl Stabilization Altitude/revolution Actuator GPS Telemetry
MODULES = Sensors Attitude/revolution ManualControl Stabilization Altitude/revolution Actuator GPS Telemetry FirmwareIAP
PYMODULES =
#FlightPlan