dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
STM32F1 Common

Files

file  common.h
 Common definitions across the bootloaders.
 
file  main.c
 Start PiOS and bootloader functions.
 
file  op_dfu.c
 This file contains the DFU commands handling code.
 
file  op_dfu.h
 This file contains the DFU commands handling code.
 

Data Structures

struct  Device
 

Macros

#define USB   0
 
#define SPI   1
 
#define DownloadDelay   100000
 
#define MAX_DEL_RETRYS   3
 
#define MAX_WRI_RETRYS   3
 
#define BSL_HOLD_STATE   ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1)
 
#define COMMAND   0
 
#define COUNT   1
 
#define DATA   5
 

Typedefs

typedef void(* pFunction )(void)
 

Enumerations

enum  DownloadAction { start, keepgoing }
 
enum  DFUStates {
  DFUidle, uploading, wrong_packet_received, too_many_packets,
  too_few_packets, Last_operation_Success, downloading, BLidle,
  Last_operation_failed, uploadingStarting, outsideDevCapabilities, CRC_Fail,
  failed_jump
}
 
enum  DFUCommands {
  Reserved, Req_Capabilities, Rep_Capabilities, EnterDFU,
  JumpFW, Reset, Abort_Operation, Upload,
  Op_END, Download_Req, Download, Status_Request,
  Status_Rep
}
 
enum  DeviceType { High_Density, Medium_Density }
 
enum  DFUTransfer { FW, Descript }
 
enum  DFUPort { Usb, Serial }
 
enum  DFUProgType { Self_flash, Remote_flash_via_spi }
 

Functions

void PIOS_Board_Init (void)
 
void FLASH_Download ()
 
uint32_t LedPWM (uint32_t pwm_period, uint32_t pwm_sweep_steps, uint32_t count)
 
uint8_t processRX ()
 
void jump_to_app ()
 
int main ()
 
void sendData (uint8_t *buf, uint16_t size)
 
uint32_t CalcFirmCRC (void)
 
void DataDownload (DownloadAction action)
 
void processComand (uint8_t *xReceive_Buffer)
 
void OPDfuIni (uint8_t discover)
 
uint32_t baseOfAdressType (DFUTransfer type)
 
uint8_t isBiggerThanAvailable (DFUTransfer type, uint32_t size)
 
bool flash_read (uint8_t *buffer, uint32_t adr, DFUProgType type)
 
uint32_t baseOfAdressType (uint8_t type)
 
uint8_t isBiggerThanAvailable (uint8_t type, uint32_t size)
 

Variables

pFunction Jump_To_Application
 
uint32_t JumpAddress
 
uint32_t period1 = 5000
 LEDs PWM. More...
 
uint32_t sweep_steps1 = 100
 
uint32_t period2 = 5000
 
uint32_t sweep_steps2 = 100
 
uint8_t tempcount = 0
 
DFUStates DeviceState
 
int16_t status = 0
 
uint8_t JumpToApp = false
 
uint8_t GO_dfu = false
 
uint8_t USB_connected = false
 
uint8_t User_DFU_request = false
 
static uint8_t mReceive_Buffer [63]
 
Device devicesTable [10]
 
uint8_t numberOfDevices = 0
 
DFUProgType currentProgrammingDestination
 
uint8_t currentDeviceCanRead
 
uint8_t currentDeviceCanWrite
 
Device currentDevice
 
uint8_t Buffer [64]
 
uint8_t echoBuffer [64]
 
uint8_t SendBuffer [64]
 
uint8_t Command = 0
 
uint8_t EchoReqFlag = 0
 
uint8_t EchoAnsFlag = 0
 
uint8_t StartFlag = 0
 
uint32_t Aditionals = 0
 
uint32_t SizeOfTransfer = 0
 
uint32_t Expected_CRC = 0
 
uint8_t SizeOfLastPacket = 0
 
uint32_t Next_Packet = 0
 
uint8_t TransferType
 
uint32_t Count = 0
 
uint32_t Data
 
uint8_t Data0
 
uint8_t Data1
 
uint8_t Data2
 
uint8_t Data3
 
uint8_t offset = 0
 
uint32_t aux
 
uint32_t downSizeOfLastPacket = 0
 
uint32_t downPacketTotal = 0
 
uint32_t downPacketCurrent = 0
 
DFUTransfer downType = 0
 
DFUStates DeviceState
 
uint8_t JumpToApp
 

Detailed Description

Macro Definition Documentation

#define BSL_HOLD_STATE   ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1)

Definition at line 39 of file main.c.

#define COMMAND   0

Definition at line 51 of file op_dfu.h.

#define COUNT   1

Definition at line 52 of file op_dfu.h.

#define DATA   5

Definition at line 53 of file op_dfu.h.

#define DownloadDelay   100000

Definition at line 111 of file common.h.

#define MAX_DEL_RETRYS   3

Definition at line 113 of file common.h.

#define MAX_WRI_RETRYS   3

Definition at line 114 of file common.h.

#define SPI   1

Definition at line 109 of file common.h.

#define USB   0

Definition at line 108 of file common.h.

Typedef Documentation

typedef void(* pFunction)(void)

Definition at line 42 of file main.c.

Enumeration Type Documentation

enum DeviceType
Enumerator
High_Density 
Medium_Density 

Definition at line 78 of file common.h.

Enumerator
Reserved 
Req_Capabilities 
Rep_Capabilities 
EnterDFU 
JumpFW 
Reset 
Abort_Operation 
Upload 
Op_END 
Download_Req 
Download 
Status_Request 
Status_Rep 

Definition at line 61 of file common.h.

enum DFUPort
Enumerator
Usb 
Serial 

Definition at line 92 of file common.h.

Enumerator
Self_flash 
Remote_flash_via_spi 

Definition at line 100 of file common.h.

enum DFUStates
Enumerator
DFUidle 
uploading 
wrong_packet_received 
too_many_packets 
too_few_packets 
Last_operation_Success 
downloading 
BLidle 
Last_operation_failed 
uploadingStarting 
outsideDevCapabilities 
CRC_Fail 
failed_jump 

Definition at line 42 of file common.h.

Enumerator
FW 
Descript 

Definition at line 84 of file common.h.

Enumerator
start 
keepgoing 

Definition at line 34 of file common.h.

Function Documentation

uint32_t baseOfAdressType ( uint8_t  type)
uint32_t baseOfAdressType ( DFUTransfer  type)

Definition at line 410 of file op_dfu.c.

uint32_t CalcFirmCRC ( void  )

Definition at line 436 of file op_dfu.c.

void DataDownload ( DownloadAction  action)

Definition at line 79 of file op_dfu.c.

void FLASH_Download ( )
bool flash_read ( uint8_t *  buffer,
uint32_t  adr,
DFUProgType  type 
)

Definition at line 454 of file op_dfu.c.

uint8_t isBiggerThanAvailable ( uint8_t  type,
uint32_t  size 
)
uint8_t isBiggerThanAvailable ( DFUTransfer  type,
uint32_t  size 
)

Definition at line 423 of file op_dfu.c.

void jump_to_app ( )

Definition at line 169 of file main.c.

uint32_t LedPWM ( uint32_t  pwm_period,
uint32_t  pwm_sweep_steps,
uint32_t  count 
)

Definition at line 190 of file main.c.

int main ( void  )

dRonin Main function:

Initialize PiOS
Create the "System" task (SystemModInitializein Modules/System/systemmod.c)
Start the RTOS Scheduler

CortexM3 CPU vectors

CortexM3 CPU vectors

Definition at line 72 of file main.c.

void OPDfuIni ( uint8_t  discover)

Definition at line 391 of file op_dfu.c.

void PIOS_Board_Init ( )

PIOS_Board_Init() initializes all the core subsystems on this specific hardware called from System/openpilot.c

Initialise PWM Output for black/white level setting PIOS_Board_Init() initializes all the core subsystems on this specific hardware called from System/openpilot.c

PIOS_Board_Init() initializes all the core subsystems on this specific hardware

PIOS_Board_Init() initializes all the core systems on this specific hardware called from System/openpilot.c

Definition at line 44 of file pios_board.c.

void processComand ( uint8_t *  xReceive_Buffer)

Definition at line 112 of file op_dfu.c.

uint8_t processRX ( )

Definition at line 201 of file main.c.

void sendData ( uint8_t *  buf,
uint16_t  size 
)

Definition at line 450 of file op_dfu.c.

Variable Documentation

uint32_t Aditionals = 0

Definition at line 52 of file op_dfu.c.

uint32_t aux

Definition at line 65 of file op_dfu.c.

uint8_t Buffer[64]

Definition at line 45 of file op_dfu.c.

uint8_t Command = 0

Definition at line 48 of file op_dfu.c.

uint32_t Count = 0

Definition at line 58 of file op_dfu.c.

Device currentDevice

Definition at line 43 of file op_dfu.c.

uint8_t currentDeviceCanRead

Definition at line 41 of file op_dfu.c.

uint8_t currentDeviceCanWrite

Definition at line 42 of file op_dfu.c.

DFUProgType currentProgrammingDestination

Definition at line 40 of file op_dfu.c.

uint32_t Data

Definition at line 59 of file op_dfu.c.

uint8_t Data0

Definition at line 60 of file op_dfu.c.

uint8_t Data1

Definition at line 61 of file op_dfu.c.

uint8_t Data2

Definition at line 62 of file op_dfu.c.

uint8_t Data3

Definition at line 63 of file op_dfu.c.

Device devicesTable[10]

Definition at line 37 of file op_dfu.c.

DFUStates DeviceState

Definition at line 60 of file main.c.

DFUStates DeviceState

Definition at line 60 of file main.c.

uint32_t downPacketCurrent = 0

Definition at line 69 of file op_dfu.c.

uint32_t downPacketTotal = 0

Definition at line 68 of file op_dfu.c.

uint32_t downSizeOfLastPacket = 0

Definition at line 67 of file op_dfu.c.

DFUTransfer downType = 0

Definition at line 70 of file op_dfu.c.

uint8_t EchoAnsFlag = 0

Definition at line 50 of file op_dfu.c.

uint8_t echoBuffer[64]

Definition at line 46 of file op_dfu.c.

uint8_t EchoReqFlag = 0

Definition at line 49 of file op_dfu.c.

uint32_t Expected_CRC = 0

Definition at line 54 of file op_dfu.c.

uint8_t GO_dfu = false

Definition at line 63 of file main.c.

pFunction Jump_To_Application

Definition at line 46 of file main.c.

uint32_t JumpAddress

Definition at line 47 of file main.c.

uint8_t JumpToApp = false

Definition at line 62 of file main.c.

uint8_t JumpToApp

Definition at line 62 of file main.c.

uint8_t mReceive_Buffer[63]
static

Definition at line 66 of file main.c.

uint32_t Next_Packet = 0

Definition at line 56 of file op_dfu.c.

uint8_t numberOfDevices = 0

Definition at line 38 of file op_dfu.c.

uint8_t offset = 0

Definition at line 64 of file op_dfu.c.

uint32_t period1 = 5000

LEDs PWM.

Definition at line 50 of file main.c.

uint32_t period2 = 5000

Definition at line 52 of file main.c.

uint8_t SendBuffer[64]

Definition at line 47 of file op_dfu.c.

uint8_t SizeOfLastPacket = 0

Definition at line 55 of file op_dfu.c.

uint32_t SizeOfTransfer = 0

Definition at line 53 of file op_dfu.c.

uint8_t StartFlag = 0

Definition at line 51 of file op_dfu.c.

int16_t status = 0

Definition at line 61 of file main.c.

uint32_t sweep_steps1 = 100

Definition at line 51 of file main.c.

uint32_t sweep_steps2 = 100

Definition at line 53 of file main.c.

uint8_t tempcount = 0

Definition at line 57 of file main.c.

uint8_t TransferType

Definition at line 57 of file op_dfu.c.

uint8_t USB_connected = false

Definition at line 64 of file main.c.

uint8_t User_DFU_request = false

Definition at line 65 of file main.c.