STM32 · code
Benewake LiDAR with STM32 I²C / UART / CAN / UART / TTL · Pixhawk Cube: code example
Setup, connection, configuration and code guidance for Benewake LiDAR with STM32. The original files are available in Materials and downloads. Documented interface: I²C, UART, CAN, UART / TTL.
Applicable setup
Benewake LiDAR · STM32 · I²C, UART, CAN, UART / TTL · Pixhawk Cube
Technical instructions and steps
dma.h
/ File Name : dma.h Description : This file contains all the function prototypes for the dma.c file This notice applies to any and all portions of this file that are not between comment pairs USER CODE BEGIN and USER CODE END. Other portions of this file, whether inserted by the user or by software development tools are owned by their respective copyright owners. Copyright (c) 2019 STMicroelectronics International N.V. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted, provided that the following conditions are met: 1. Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of other contributors to this software may be used to endorse or promote products derived from this software without specific written permission. 4. This software, including modifications and/or derivative works of this software, must execute solely and exclusively on microcontroller or microprocessor devices manufactured by or for STMicroelectronics. 5. Redistribution and use of this software other than as permitted under this license is void and will automatically terminate your rights under this license. THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. / / Define to prevent recursive inclusion -------------------------------------/ #ifndef dmaH #define dmaH
#ifdef __cplusplus extern "C" { #endif
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/* DMA memory to memory transfer handles -------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */
void MX_DMA_Init(void);
/* USER CODE BEGIN Prototypes */
/* USER CODE END Prototypes */#ifdef __cplusplus } #endif
#endif / _dmaH /
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/FreeRTOSConfig.h
/* USER CODE BEGIN Header */
/*
FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.
All rights reservedVISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
>>! NOTE: The modification to the GPL is included to allow you to !<< >>! distribute a combined work that includes FreeRTOS without being !<< >>! obliged to provide the source code for proprietary components !<< >>! outside of the FreeRTOS kernel. !<<
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Full license text is available on the following link: http://www.freertos.org/a00114.html
FreeRTOS provides completely free yet professionally developed, robust, strictly quality controlled, supported, and cross platform software that is more than just the market leader, it is the industry's de facto standard. Help yourself get started quickly while simultaneously helping to support the FreeRTOS project by purchasing a FreeRTOS tutorial book, reference manual, or both: http://www.FreeRTOS.org/Documentation
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading the FAQ page "My application does not run, what could be wrong?". Have you defined configASSERT()?
http://www.FreeRTOS.org/support - In return for receiving this top quality embedded software for free we request you assist our global community by participating in the support forum.
http://www.FreeRTOS.org/training - Investing in training allows your team to be as productive as possible as early as possible. Now you can receive FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers Ltd, and the world's leading authority on the world's leading RTOS.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, a DOS compatible FAT file system, and our tiny thread aware UDP/IP stack.
http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS licenses offer ticketed support, indemnification and commercial middleware.
http://www.SafeRTOS.com - High Integrity Systems also provide a safety engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability.
1 tab == 4 spaces!
*/
/* USER CODE END Header */#ifndef FREERTOSCONFIGH #define FREERTOSCONFIGH
/----------------------------------------------------------- Application specific definitions. These definitions should be adjusted for your particular hardware and application requirements. THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. See http://www.freertos.org/a00110.html. ----------------------------------------------------------/
/* USER CODE BEGIN Includes */
/* Section where include file can be added */
#include "SEGGER_SYSVIEW_FreeRTOS.h"
/* USER CODE END Includes *// Ensure stdint is only used by the compiler, and not the assembler. / #if defined(ICCARM) || defined(CCARM) || defined(GNUC) #include <stdint.h> extern uint32t SystemCoreClock; #endif
#define configUSEPREEMPTION 1 #define configSUPPORTSTATICALLOCATION 0 #define configSUPPORTDYNAMICALLOCATION 1 #define configUSEIDLEHOOK 0 #define configUSETICKHOOK 0 #define configCPUCLOCKHZ ( SystemCoreClock ) #define configTICKRATEHZ ((TickTypet)1000) #define configMAXPRIORITIES ( 7 ) #define configMINIMALSTACKSIZE ((uint16t)128) #define configTOTALHEAPSIZE ((sizet)4096) #define configMAXTASKNAMELEN ( 16 ) #define configUSE16BITTICKS 0 #define configUSEMUTEXES 1 #define configQUEUEREGISTRYSIZE 8 #define configUSECOUNTINGSEMAPHORES 1 #define configUSEPORTOPTIMISEDTASKSELECTION 1
/ Co-routine definitions. / #define configUSECOROUTINES 0 #define configMAXCOROUTINE_PRIORITIES ( 2 )
/ Set the following definitions to 1 to include the API function, or zero to exclude the API function. / #define INCLUDEvTaskPrioritySet 1 #define INCLUDEuxTaskPriorityGet 1 #define INCLUDEvTaskDelete 1 #define INCLUDEvTaskCleanUpResources 0 #define INCLUDEvTaskSuspend 1 #define INCLUDEvTaskDelayUntil 1 #define INCLUDEvTaskDelay 1 #define INCLUDExTaskGetSchedulerState 1
/ Cortex-M specific definitions. / #ifdef NVICPRIOBITS / BVICPRIOBITS will be specified when CMSIS is being used. / #define configPRIOBITS NVICPRIOBITS #else #define configPRIOBITS 4 #endif
/ The lowest interrupt priority that can be used in a call to a "set priority" function. / #define configLIBRARYLOWESTINTERRUPT_PRIORITY 15
/ The highest interrupt priority that can be used by any interrupt service routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER PRIORITY THAN THIS! (higher priorities are lower numeric values. / #define configLIBRARYMAXSYSCALLINTERRUPTPRIORITY 5
/ Interrupt priorities used by the kernel port layer itself. These are generic to all Cortex-M ports, and do not rely on any particular library functions. / #define configKERNELINTERRUPTPRIORITY ( configLIBRARYLOWESTINTERRUPTPRIORITY << (8 - configPRIOBITS) ) / !!!! configMAXSYSCALLINTERRUPTPRIORITY must not be set to zero !!!! See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. / #define configMAXSYSCALLINTERRUPTPRIORITY ( configLIBRARYMAXSYSCALLINTERRUPTPRIORITY << (8 - configPRIO_BITS) )
/* Normal assert() semantics without relying on the provision of an assert.h
header file. */
/* USER CODE BEGIN 1 */
#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); for( ;; );}
/* USER CODE END 1 *// Definitions that map the FreeRTOS port interrupt handlers to their CMSIS standard names. / #define vPortSVCHandler SVCHandler #define xPortPendSVHandler PendSVHandler
/ IMPORTANT: This define is commented when used with STM32Cube firmware, when timebase is systick, to prevent overwriting SysTickHandler defined within STM32Cube HAL / #define xPortSysTickHandler SysTickHandler
/* USER CODE BEGIN Defines */
/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */
/* USER CODE END Defines */#endif / FREERTOSCONFIGH /
gpio.h
/ File Name : gpio.h Description : This file contains all the functions prototypes for the gpio This notice applies to any and all portions of this file that are not between comment pairs USER CODE BEGIN and USER CODE END. Other portions of this file, whether inserted by the user or by software development tools are owned by their respective copyright owners. Copyright (c) 2019 STMicroelectronics International N.V. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted, provided that the following conditions are met: 1. Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of other contributors to this software may be used to endorse or promote products derived from this software without specific written permission. 4. This software, including modifications and/or derivative works of this software, must execute solely and exclusively on microcontroller or microprocessor devices manufactured by or for STMicroelectronics. 5. Redistribution and use of this software other than as permitted under this license is void and will automatically terminate your rights under this license. THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /
/ Define to prevent recursive inclusion -------------------------------------/ #ifndef gpioH #define gpioH #ifdef __cplusplus extern "C" { #endif
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */
void MX_GPIO_Init(void);
/* USER CODE BEGIN Prototypes */
/* USER CODE END Prototypes */#ifdef cplusplus } #endif #endif / pinoutConfig_H /
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/i2c.h
/ File Name : I2C.h Description : This file provides code for the configuration of the I2C instances. This notice applies to any and all portions of this file that are not between comment pairs USER CODE BEGIN and USER CODE END. Other portions of this file, whether inserted by the user or by software development tools are owned by their respective copyright owners. Copyright (c) 2019 STMicroelectronics International N.V. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted, provided that the following conditions are met: 1. Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of other contributors to this software may be used to endorse or promote products derived from this software without specific written permission. 4. This software, including modifications and/or derivative works of this software, must execute solely and exclusively on microcontroller or microprocessor devices manufactured by or for STMicroelectronics. 5. Redistribution and use of this software other than as permitted under this license is void and will automatically terminate your rights under this license. THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. / / Define to prevent recursive inclusion -------------------------------------/ #ifndef i2cH #define i2cH #ifdef __cplusplus extern "C" { #endif
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */extern I2C_HandleTypeDef hi2c2;
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */
void MX_I2C2_Init(void);
/* USER CODE BEGIN Prototypes */
/* USER CODE END Prototypes */#ifdef cplusplus } #endif #endif / i2c_H /
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/main.h
/ USER CODE BEGIN Header / / @file : main.h @brief : Header for main.c file. This file contains the common defines of the application. This notice applies to any and all portions of this file that are not between comment pairs USER CODE BEGIN and USER CODE END. Other portions of this file, whether inserted by the user or by software development tools are owned by their respective copyright owners. Copyright (c) 2019 STMicroelectronics International N.V. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted, provided that the following conditions are met: 1. Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of other contributors to this software may be used to endorse or promote products derived from this software without specific written permission. 4. This software, including modifications and/or derivative works of this software, must execute solely and exclusively on microcontroller or microprocessor devices manufactured by or for STMicroelectronics. 5. Redistribution and use of this software other than as permitted under this license is void and will automatically terminate your rights under this license. THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. / / USER CODE END Header /
/ Define to prevent recursive inclusion -------------------------------------/ #ifndef MAINH #define MAINH
#ifdef __cplusplus extern "C" { #endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_hal.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */
/* USER CODE END ET */
/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */
/* USER CODE END EC */
/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */
/* USER CODE END EM */
/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);
/* USER CODE BEGIN EFP */
/* USER CODE END EFP *// Private defines -----------------------------------------------------------/ #define UART2TXPCPin GPIOPIN2 #define UART2TXPCGPIOPort GPIOA #define UART2RXPCPin GPIOPIN3 #define UART2RXPCGPIOPort GPIOA #define LEDPin GPIOPIN8 #define LEDGPIOPort GPIOA / USER CODE BEGIN Private defines / // CUBE同时使能I2C2和UART3时,自动将UART3重映射到PBC了,这里手动改回�? #undef UART3TXMINIPGPIOPort #undef UART3RXMINIPGPIOPort #define UART3TXMINIPGPIOPort GPIOB #define UART3RXMINIPGPIO_Port GPIOB / USER CODE END Private defines /
#ifdef __cplusplus } #endif
#endif / _MAINH /
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/stm32f1xxhalconf.h
/ @file stm32f1xxhalconf.h @brief HAL configuration file. @attention <h2><center>© COPYRIGHT(c) 2019 STMicroelectronics</center></h2> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/ Define to prevent recursive inclusion -------------------------------------/ #ifndef STM32F1xxHALCONFH #define STM32F1xxHALCONFH
#ifdef __cplusplus extern "C" { #endif
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
*/
#define HAL_MODULE_ENABLED
/*#define HAL_ADC_MODULE_ENABLED */
/*#define HAL_CRYP_MODULE_ENABLED */
/*#define HAL_CAN_MODULE_ENABLED */
/*#define HAL_CEC_MODULE_ENABLED */
/*#define HAL_CORTEX_MODULE_ENABLED */
/*#define HAL_CRC_MODULE_ENABLED */
/*#define HAL_DAC_MODULE_ENABLED */
#define HAL_DMA_MODULE_ENABLED
/*#define HAL_ETH_MODULE_ENABLED */
/*#define HAL_FLASH_MODULE_ENABLED */
#define HAL_GPIO_MODULE_ENABLED
#define HAL_I2C_MODULE_ENABLED
/*#define HAL_I2S_MODULE_ENABLED */
/*#define HAL_IRDA_MODULE_ENABLED */
/*#define HAL_IWDG_MODULE_ENABLED */
/*#define HAL_NOR_MODULE_ENABLED */
/*#define HAL_NAND_MODULE_ENABLED */
/*#define HAL_PCCARD_MODULE_ENABLED */
/*#define HAL_PCD_MODULE_ENABLED */
/*#define HAL_HCD_MODULE_ENABLED */
/*#define HAL_PWR_MODULE_ENABLED */
/*#define HAL_RCC_MODULE_ENABLED */
/*#define HAL_RTC_MODULE_ENABLED */
/*#define HAL_SD_MODULE_ENABLED */
/*#define HAL_MMC_MODULE_ENABLED */
/*#define HAL_SDRAM_MODULE_ENABLED */
/*#define HAL_SMARTCARD_MODULE_ENABLED */
/*#define HAL_SPI_MODULE_ENABLED */
/*#define HAL_SRAM_MODULE_ENABLED */
#define HAL_TIM_MODULE_ENABLED
#define HAL_UART_MODULE_ENABLED
/*#define HAL_USART_MODULE_ENABLED */
/*#define HAL_WWDG_MODULE_ENABLED */
/*#define HAL_EXTI_MODULE_ENABLED */#define HALCORTEXMODULEENABLED #define HALDMAMODULEENABLED #define HALFLASHMODULEENABLED #define HALGPIOMODULEENABLED #define HALPWRMODULEENABLED #define HALRCCMODULEENABLED
/ ########################## Oscillator Values adaptation ####################/ /* @brief Adjust the value of External High Speed oscillator (HSE) used in your application. This value is used by the RCC HAL module to compute the system frequency (when HSE is used as system clock source, directly or through the PLL). / #if !defined (HSEVALUE) #define HSEVALUE ((uint32t)12000000) /!< Value of the External oscillator in Hz / #endif / HSEVALUE */
#if !defined (HSESTARTUPTIMEOUT) #define HSESTARTUPTIMEOUT ((uint32t)100) /!< Time out for HSE start up, in ms / #endif / HSESTARTUP_TIMEOUT /
/* @brief Internal High Speed oscillator (HSI) value. This value is used by the RCC HAL module to compute the system frequency (when HSI is used as system clock source, directly or through the PLL). / #if !defined (HSIVALUE) #define HSIVALUE ((uint32t)8000000) /!< Value of the Internal oscillator in Hz/ #endif / HSIVALUE */
/* @brief Internal Low Speed oscillator (LSI) value. / #if !defined (LSIVALUE) #define LSIVALUE 40000U /!< LSI Typical Value in Hz / #endif / LSI_VALUE / /!< Value of the Internal Low Speed oscillator in Hz The real value may vary depending on the variations in voltage and temperature. */
/* @brief External Low Speed oscillator (LSE) value. This value is used by the UART, RTC HAL module to compute the system frequency / #if !defined (LSEVALUE) #define LSEVALUE ((uint32t)32768) /!< Value of the External oscillator in Hz/ #endif / LSEVALUE /
#if !defined (LSESTARTUPTIMEOUT) #define LSESTARTUPTIMEOUT ((uint32t)5000) /!< Time out for LSE start up, in ms / #endif / LSESTARTUP_TIMEOUT /
/* Tip: To avoid modifying this file each time you need to use different HSE,
=== you can define the HSE value in your toolchain compiler preprocessor. *// ########################### System Configuration ######################### / /* @brief This is the HAL system configuration section / #define VDDVALUE ((uint32t)3300) /!< Value of VDD in mv / #define TICKINTPRIORITY ((uint32t)0) /!< tick interrupt priority (lowest by default) */ #define USERTOS 0 #define PREFETCH_ENABLE 1
/* ########################## Assert Selection ############################## */
/**
* @brief Uncomment the line below to expanse the "assert_param" macro in the
* HAL drivers code
*/
/* #define USE_FULL_ASSERT 1U */
/* ################## Ethernet peripheral configuration ##################### */
/* Section 1 : Ethernet peripheral configuration *// MAC ADDRESS: MACADDR0:MACADDR1:MACADDR2:MACADDR3:MACADDR4:MACADDR5 / #define MACADDR0 2 #define MACADDR1 0 #define MACADDR2 0 #define MACADDR3 0 #define MACADDR4 0 #define MACADDR5 0
/ Definition of the Ethernet driver buffers size and count / #define ETHRXBUFSIZE ETHMAXPACKETSIZE / buffer size for receive / #define ETHTXBUFSIZE ETHMAXPACKETSIZE / buffer size for transmit / #define ETHRXBUFNB ((uint32t)8) / 4 Rx buffers of size ETHRXBUFSIZE / #define ETHTXBUFNB ((uint32t)4) / 4 Tx buffers of size ETHTXBUFSIZE /
/* Section 2: PHY configuration section */
/* DP83848_PHY_ADDRESS Address*/
#define DP83848_PHY_ADDRESS 0x01U
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
#define PHY_RESET_DELAY ((uint32_t)0x000000FF)
/* PHY Configuration delay */
#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF)#define PHYREADTO ((uint32t)0x0000FFFF) #define PHYWRITETO ((uint32t)0x0000FFFF)
/* Section 3: Common PHY Registers */#define PHYBCR ((uint16t)0x00) /!< Transceiver Basic Control Register / #define PHYBSR ((uint16t)0x01) /!< Transceiver Basic Status Register /
#define PHYRESET ((uint16t)0x8000) /!< PHY Reset / #define PHYLOOPBACK ((uint16t)0x4000) /!< Select loop-back mode / #define PHYFULLDUPLEX100M ((uint16t)0x2100) /!< Set the full-duplex mode at 100 Mb/s / #define PHYHALFDUPLEX100M ((uint16t)0x2000) /!< Set the half-duplex mode at 100 Mb/s / #define PHYFULLDUPLEX10M ((uint16t)0x0100) /!< Set the full-duplex mode at 10 Mb/s / #define PHYHALFDUPLEX10M ((uint16t)0x0000) /!< Set the half-duplex mode at 10 Mb/s / #define PHYAUTONEGOTIATION ((uint16t)0x1000) /!< Enable auto-negotiation function / #define PHYRESTARTAUTONEGOTIATION ((uint16t)0x0200) /!< Restart auto-negotiation function / #define PHYPOWERDOWN ((uint16t)0x0800) /!< Select the power down mode / #define PHYISOLATE ((uint16_t)0x0400) /!< Isolate PHY from MII /
#define PHYAUTONEGOCOMPLETE ((uint16t)0x0020) /!< Auto-Negotiation process completed / #define PHYLINKEDSTATUS ((uint16t)0x0004) /!< Valid link established / #define PHYJABBERDETECTION ((uint16_t)0x0002) /!< Jabber condition detected /
/* Section 4: Extended PHY Registers */
#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */#define PHYSPEEDSTATUS ((uint16t)0x0002U) /!< PHY Speed mask / #define PHYDUPLEXSTATUS ((uint16t)0x0004U) /!< PHY Duplex mask /
/* Includes ------------------------------------------------------------------*/
/**
* @brief Include module's header file
*/#ifdef HALRCCMODULEENABLED #include "stm32f1xxhalrcc.h" #endif / HALRCCMODULEENABLED /
#ifdef HALEXTIMODULEENABLED #include "stm32f1xxhalexti.h" #endif / HALEXTIMODULEENABLED /
#ifdef HALGPIOMODULEENABLED #include "stm32f1xxhalgpio.h" #endif / HALGPIOMODULEENABLED /
#ifdef HALDMAMODULEENABLED #include "stm32f1xxhaldma.h" #endif / HALDMAMODULEENABLED /
#ifdef HALETHMODULEENABLED #include "stm32f1xxhaleth.h" #endif / HALETHMODULEENABLED /
#ifdef HALCANMODULEENABLED #include "stm32f1xxhalcan.h" #endif / HALCANMODULEENABLED /
#ifdef HALCECMODULEENABLED #include "stm32f1xxhalcec.h" #endif / HALCECMODULEENABLED /
#ifdef HALCORTEXMODULEENABLED #include "stm32f1xxhalcortex.h" #endif / HALCORTEXMODULEENABLED /
#ifdef HALADCMODULEENABLED #include "stm32f1xxhaladc.h" #endif / HALADCMODULEENABLED /
#ifdef HALCRCMODULEENABLED #include "stm32f1xxhalcrc.h" #endif / HALCRCMODULEENABLED /
#ifdef HALDACMODULEENABLED #include "stm32f1xxhaldac.h" #endif / HALDACMODULEENABLED /
#ifdef HALFLASHMODULEENABLED #include "stm32f1xxhalflash.h" #endif / HALFLASHMODULEENABLED /
#ifdef HALSRAMMODULEENABLED #include "stm32f1xxhalsram.h" #endif / HALSRAMMODULEENABLED /
#ifdef HALNORMODULEENABLED #include "stm32f1xxhalnor.h" #endif / HALNORMODULEENABLED /
#ifdef HALI2CMODULEENABLED #include "stm32f1xxhali2c.h" #endif / HALI2CMODULEENABLED /
#ifdef HALI2SMODULEENABLED #include "stm32f1xxhali2s.h" #endif / HALI2SMODULEENABLED /
#ifdef HALIWDGMODULEENABLED #include "stm32f1xxhaliwdg.h" #endif / HALIWDGMODULEENABLED /
#ifdef HALPWRMODULEENABLED #include "stm32f1xxhalpwr.h" #endif / HALPWRMODULEENABLED /
#ifdef HALRTCMODULEENABLED #include "stm32f1xxhalrtc.h" #endif / HALRTCMODULEENABLED /
#ifdef HALPCCARDMODULEENABLED #include "stm32f1xxhalpccard.h" #endif / HALPCCARDMODULEENABLED /
#ifdef HALSDMODULEENABLED #include "stm32f1xxhalsd.h" #endif / HALSDMODULEENABLED /
#ifdef HALMMCMODULEENABLED #include "stm32f1xxhalmmc.h" #endif / HALMMCMODULEENABLED /
#ifdef HALNANDMODULEENABLED #include "stm32f1xxhalnand.h" #endif / HALNANDMODULEENABLED /
#ifdef HALSPIMODULEENABLED #include "stm32f1xxhalspi.h" #endif / HALSPIMODULEENABLED /
#ifdef HALTIMMODULEENABLED #include "stm32f1xxhaltim.h" #endif / HALTIMMODULEENABLED /
#ifdef HALUARTMODULEENABLED #include "stm32f1xxhaluart.h" #endif / HALUARTMODULEENABLED /
#ifdef HALUSARTMODULEENABLED #include "stm32f1xxhalusart.h" #endif / HALUSARTMODULEENABLED /
#ifdef HALIRDAMODULEENABLED #include "stm32f1xxhalirda.h" #endif / HALIRDAMODULEENABLED /
#ifdef HALSMARTCARDMODULEENABLED #include "stm32f1xxhalsmartcard.h" #endif / HALSMARTCARDMODULEENABLED /
#ifdef HALWWDGMODULEENABLED #include "stm32f1xxhalwwdg.h" #endif / HALWWDGMODULEENABLED /
#ifdef HALPCDMODULEENABLED #include "stm32f1xxhalpcd.h" #endif / HALPCDMODULEENABLED /
#ifdef HALHCDMODULEENABLED #include "stm32f1xxhalhcd.h" #endif / HALHCDMODULEENABLED /
/ Exported macro ------------------------------------------------------------/ #ifdef USEFULLASSERT /* @brief The assertparam macro is used for function's parameters check. @param expr: If expr is false, it calls assertfailed function which reports the name of the source file and the source line number of the call that failed. If expr is true, it returns no value. @retval None / #define assertparam(expr) ((expr) ? (void)0U : assertfailed((uint8t )FILE, LINE)) / Exported functions ------------------------------------------------------- / void assertfailed(uint8t file, uint32t line); #else #define assertparam(expr) ((void)0U) #endif / USEFULL_ASSERT /
#ifdef __cplusplus } #endif
#endif / _STM32F1xxHALCONFH /
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/stm32f1xx_it.h
/ USER CODE BEGIN Header / / @file stm32f1xx_it.h @brief This file contains the headers of the interrupt handlers. COPYRIGHT(c) 2019 STMicroelectronics Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. / / USER CODE END Header /
/ Define to prevent recursive inclusion -------------------------------------/ #ifndef STM32F1xxITH #define STM32F1xxITH
#ifdef __cplusplus extern "C" { #endif
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */
/* USER CODE END ET */
/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */
/* USER CODE END EC */
/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */
/* USER CODE END EM */
/* Exported functions prototypes ---------------------------------------------*/
void NMI_Handler(void);
void HardFault_Handler(void);
void MemManage_Handler(void);
void BusFault_Handler(void);
void UsageFault_Handler(void);
void DebugMon_Handler(void);
void DMA1_Channel6_IRQHandler(void);
void DMA1_Channel7_IRQHandler(void);
void I2C2_EV_IRQHandler(void);
void I2C2_ER_IRQHandler(void);
void USART2_IRQHandler(void);
void TIM8_UP_IRQHandler(void);
/* USER CODE BEGIN EFP */
/* USER CODE END EFP */#ifdef __cplusplus } #endif
#endif / _STM32F1xxIT_H /
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/tim.h
/ File Name : TIM.h Description : This file provides code for the configuration of the TIM instances. This notice applies to any and all portions of this file that are not between comment pairs USER CODE BEGIN and USER CODE END. Other portions of this file, whether inserted by the user or by software development tools are owned by their respective copyright owners. Copyright (c) 2019 STMicroelectronics International N.V. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted, provided that the following conditions are met: 1. Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of other contributors to this software may be used to endorse or promote products derived from this software without specific written permission. 4. This software, including modifications and/or derivative works of this software, must execute solely and exclusively on microcontroller or microprocessor devices manufactured by or for STMicroelectronics. 5. Redistribution and use of this software other than as permitted under this license is void and will automatically terminate your rights under this license. THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. / / Define to prevent recursive inclusion -------------------------------------/ #ifndef timH #define timH #ifdef __cplusplus extern "C" { #endif
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */extern TIM_HandleTypeDef htim1;
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */
void MX_TIM1_Init(void);
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
/* USER CODE BEGIN Prototypes */
/* USER CODE END Prototypes */#ifdef cplusplus } #endif #endif / tim_H /
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/usart.h
/ File Name : USART.h Description : This file provides code for the configuration of the USART instances. This notice applies to any and all portions of this file that are not between comment pairs USER CODE BEGIN and USER CODE END. Other portions of this file, whether inserted by the user or by software development tools are owned by their respective copyright owners. Copyright (c) 2019 STMicroelectronics International N.V. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted, provided that the following conditions are met: 1. Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of other contributors to this software may be used to endorse or promote products derived from this software without specific written permission. 4. This software, including modifications and/or derivative works of this software, must execute solely and exclusively on microcontroller or microprocessor devices manufactured by or for STMicroelectronics. 5. Redistribution and use of this software other than as permitted under this license is void and will automatically terminate your rights under this license. THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. / / Define to prevent recursive inclusion -------------------------------------/ #ifndef usartH #define usartH #ifdef __cplusplus extern "C" { #endif
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */extern UART_HandleTypeDef huart2;
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */
void MX_USART2_UART_Init(void);
/* USER CODE BEGIN Prototypes */
/* USER CODE END Prototypes */#ifdef cplusplus } #endif #endif / usart_H /
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/frame.h
/ @文件 frame.h @作者 ZhuXiongwei @描述 frame模块的接口头文件 frame模块提供3类接口:基础接口、扩展接口、调试接口。 基础接口:使用数据帧的默认格式,即 | 0x44 | len | id | payload | checksum | 扩展接口:支持删除frame模块、修改帧头、去除帧头、去除校验、修改为crc32校验等扩展 功能。如果用户提供获取系统时钟的接口,可以使frame模块具备搜索超时功能。 调试接口:为方便用户使用此模块时的调试需求开放的接口。 ** /
#ifndef FRAMEH #define FRAMEH
#ifdef __cplusplus extern "C" { #endif
#include <stdlib.h>
#include <stdint.h>
/**
* @描述 frame模块的句柄,用户使用frame模块前,必须先通过Frame_New函数获取一个有效的frame句柄。
*/
typedef struct __Frame_HandleStruct *Frame_HandlePtr;
/**
* @描述 获取系统时钟的函数原型
*/
typedef uint32_t (*GetTickFuncPtr)(void);
/**
* @描述 frame模块的状态枚举
*/
typedef enum
{
FRAME_OK = 0, /*!< 状态正常或得到后效数据帧 */
FRAME_LESS, /*!< 没有从FIFO中搜索到有效数据帧 */
FRAME_FIFO_OVERFLOW, /*!< FIFO溢出 */
FRAME_NULL_PTR /*!< 不是有效的frame句柄 */
}Frame_StatusEnum;
/**
* @描述 帧校验类型枚举
*/
typedef enum
{
FRAME_CHECK_NONE = 0,
FRAME_CHECK_SUM,
FRAME_CHECK_CRC32
}Frame_CheckTypeEnum;/ 基础接口 ** /
/* @brief 为一个新的frame模块申请内存,返回frame句柄。 @param fifosize: 循环FIFO的大小 @param framebuf: 有效数据帧的存放地址,由用户自行申请内存,将内存指针传入此函数。frame模块搜索 到有效数据帧后,将其从FIFO读出到framebuf所指向的内存,供用户进一步解析。 @param framebufsize: framebuf指向的内存空间的大小,该大小应该由最长数据帧的长度决定,最大为256。 @retval frame句柄 / extern FrameHandlePtr FrameNew(uint32t fifosize, uint8t *framebuf, uint16t framebuf_size);
/* @brief 将通信端口收到的数据写入frame模块的循环FIFO。 @param hframe: frame句柄。 @param buf: 接收端口缓存地址,或用户自定义的内存地址,该地址存放了通信端口收到的数据 @param size: 写入数据的大小 @retval frame状态 / extern FrameStatusEnum FrameWriteFifo(FrameHandlePtr hframe, uint8t buf, uint32_t size);
/* @brief 从循环FIFO中搜索数据帧,所搜到有效数据帧时,将有效数据帧复制到FrameNew接口的framebuf参数指向的内存 同时返回FRAMEOK。如果此时FIFO中累积了多个有效数据帧,此函数的一次调用将只获取一个有效数据帧。 @param hframe: frame句柄。 @retval frame状态 / extern FrameStatusEnum FrameSearch(FrameHandlePtr hframe);
/ 扩展接口 ** /
/* @brief 销毁frame模块,释放内存 @param hframe: frame句柄。 @retval 无 */ extern void FrameDelete(FrameHandlePtr hframe);
/* @brief 修改数据帧帧头,默认帧头为 0x44('D') @param hframe: frame句柄。 @param head: 将要生效的帧头。 @retval 无 / extern void FrameSetHead(FrameHandlePtr hframe, uint8_t head);
/* @brief 修改帧校验类型 @param hframe: frame句柄。 @param checktype: 帧校验类型,详见 FrameCheckTypeEnum 定义。 @retval 无 / extern void FrameSetCheckArith(FrameHandlePtr hframe, FrameCheckTypeEnum checktype);
/* @brief 去除帧头 @param hframe: frame句柄。 @retval 无 */ extern void FrameDiscardHead(FrameHandlePtr hframe);
/* @brief 注册获取系统时钟的函数,用于使能frame模块的帧搜索超时机制。 应对的情况:当有异常数据被写入FIFO,且其中的帧长字节为一个很大的值,此时将导致 frame模块持续等待足够的数据写入FIFO才进行下一步判断,而后续的有效数据帧无法被检测到。 @param hframe: frame句柄。 @param func: 获取系统时钟的函数指针。 @param timeout: 超时时间,单位与func的返回值一致。 @retval 无 */ extern void FrameRegGetTickFunc(FrameHandlePtr hframe, GetTickFuncPtr func, uint32_t timeout);
/ 调试接口 ** /
/* @brief 获取FIFO中已写入的数据大小。 @param hframe: frame句柄。 @retval FIFO中已写入的数据大小 */ extern uint32t FrameGetFifoDataSize(Frame_HandlePtr hframe);
/* @brief 直接将FIFO中的数据拷贝到framebuf指向的内存,如果FIFO中的数据量大于framebufsize, 最多拷贝framebufsize大小的数据。 @param hframe: frame句柄。 @retval 实际拷贝的数据量 / extern uint32t FrameCopyFifoDataToFrameBuf(FrameHandlePtr hframe);
/* @brief 计算校验和。 @param data: 数据内存指针。 @param size: 数据大小。 @retval 校验和 / extern uint8t FrameCalSum(uint8t *data, uint32t size);
/* @brief 计算crc32校验值,支持非4字节对齐的数据计算。 @param data: 数据内存指针。 @param size: 数据大小。 @retval crc32校验值 / extern uint32t FrameCalCrc32(uint8t *data, uint32t size);
#ifdef __cplusplus } #endif #endif
JLinkLog.txt
T05A4 12011:892 SEGGER J-Link V6.30h Log File (0000ms, 7846ms total) T05A4 12011:892 DLL Compiled: Mar 16 2018 18:02:51 (0000ms, 7846ms total) T05A4 12011:892 Logging started @ 2019-04-01 18:13 (0000ms, 7846ms total) T05A4 12011:892 JLINKSetWarnOutHandler(...) (0000ms, 7846ms total) T05A4 12011:892 JLINKOpenEx(...) Firmware: J-Link V9 compiled Mar 2 2018 17:07:57 Hardware: V9.60 S/N: 59600175 Feature(s): RDI, GDB, FlashDL, FlashBP, JFlash TELNET listener socket opened on port 19021WEBSRV Starting webserver (0195ms, 8041ms total) T05A4 12011:892 WEBSRV Webserver running on local port 19080 (0195ms, 8041ms total) T05A4 12011:892 returns O.K. (0195ms, 8041ms total) T05A4 12012:087 JLINKGetEmuCaps() returns 0xB9FF7BBF (0000ms, 8041ms total) T05A4 12012:088 JLINKTIFGetAvailable(...) (0000ms, 8041ms total) T05A4 12012:088 JLINKSetErrorOutHandler(...) (0000ms, 8041ms total) T05A4 12012:088 JLINKExecCommand("ProjectFile = "D:\Projects\TF-MINI-P\I2cpinboard\MINIPI2CUART\MDK-ARM\JLinkSettings.ini"", ...). returns 0x00 (0004ms, 8045ms total) T05A4 12012:100 JLINKExecCommand("Device = STM32F103RC", ...). Device "STM32F103RC" selected. returns 0x00 (0006ms, 8051ms total) T05A4 12012:106 JLINKExecCommand("DisableConnectionTimeout", ...). returns 0x01 (0000ms, 8051ms total) T05A4 12012:106 JLINKGetHardwareVersion() returns 0x17700 (0000ms, 8051ms total) T05A4 12012:106 JLINKGetDLLVersion() returns 63008 (0000ms, 8051ms total) T05A4 12012:106 JLINKGetFirmwareString(...) (0000ms, 8051ms total) T05A4 12012:124 JLINKGetDLLVersion() returns 63008 (0000ms, 8051ms total) T05A4 12012:124 JLINKGetCompileDateTime() (0000ms, 8051ms total) T05A4 12012:130 JLINKGetFirmwareString(...) (0000ms, 8051ms total) T05A4 12012:142 JLINKGetHardwareVersion() returns 0x17700 (0000ms, 8051ms total) T05A4 12012:207 JLINKTIFSelect(JLINKARMTIFSWD) returns 0x00 (0001ms, 8052ms total) T05A4 12012:208 JLINKSetSpeed(5000) (0000ms, 8052ms total) T05A4 12012:208 JLINKGetId() >0x10B TIF>Found SW-DP with ID 0x1BA01477 >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x21 TIF> >0x10B TIF>Found SW-DP with ID 0x1BA01477 >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x28 TIF>Scanning AP map to find all available APs >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x21 TIF>AP[1]: Stopped AP scan as end of AP map has been reachedAP[0]: AHB-AP (IDR: 0x14770011)Iterating through AP map to find AHB-AP to use >0x42 TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x21 TIF> >0x42 TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x21 TIF>AP[0]: Core foundAP[0]: AHB-AP ROM base: 0xE00FF000 >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x21 TIF> >0x0D TIF> >0x21 TIF>CPUID register: 0x411FC231. Implementer code: 0x41 (ARM)Found Cortex-M3 r1p1, Little endian. -- CPUReadMem(4 bytes @ 0xE000EDF0) -- CPUWriteMem(4 bytes @ 0xE000EDF0) -- CPUReadMem(4 bytes @ 0xE0002000)FPUnit: 6 code (BP) slots and 2 literal slots -- CPUReadMem(4 bytes @ 0xE000EDFC) -- CPUWriteMem(4 bytes @ 0xE000EDFC) -- CPUReadMem(4 bytes @ 0xE0001000) -- CPUWriteMem(4 bytes @ 0xE0001000) -- CPUReadMem(4 bytes @ 0xE000ED88) -- CPUWriteMem(4 bytes @ 0xE000ED88) -- CPUReadMem(4 bytes @ 0xE000ED88) -- CPUWriteMem(4 bytes @ 0xE000ED88)CoreSight components:ROMTbl[0] @ E00FF000 -- CPUReadMem(16 bytes @ 0xE00FF000) -- CPUReadMem(16 bytes @ 0xE000EFF0) -- CPUReadMem(16 bytes @ 0xE000EFE0)ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 001BB000 SCS -- CPUReadMem(16 bytes @ 0xE0001FF0) -- CPUReadMem(16 bytes @ 0xE0001FE0)ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 001BB002 DWT -- CPUReadMem(16 bytes @ 0xE0002FF0) -- CPUReadMem(16 bytes @ 0xE0002FE0) ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB003 FPB -- CPUReadMem(16 bytes @ 0xE0000FF0) -- CPUReadMem(16 bytes @ 0xE0000FE0)ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 001BB001 ITM -- CPUReadMem(16 bytes @ 0xE00FF010) -- CPUReadMem(16 bytes @ 0xE0040FF0) -- CPUReadMem(16 bytes @ 0xE0040FE0)ROMTbl[0][4]: E0040000, CID: B105900D, PID: 001BB923 TPIU-Lite -- CPUReadMem(16 bytes @ 0xE0041FF0) -- CPUReadMem(16 bytes @ 0xE0041FE0)ROMTbl[0][5]: E0041000, CID: B105900D, PID: 101BB924 ETM-M3 >0x0D TIF> >0x21 TIF> returns 0x1BA01477 (0322ms, 8374ms total) T05A4 12012:530 JLINKGetDLLVersion() returns 63008 (0000ms, 8374ms total) T05A4 12012:530 JLINKCOREGetFound() returns 0x30000FF (0000ms, 8374ms total) T05A4 12012:530 JLINKGetDebugInfo(0x100 = JLINKARMROMTABLEADDRINDEX) -- Value=0xE00FF000 returns 0x00 (0000ms, 8374ms total) T05A4 12012:541 JLINKGetDebugInfo(0x100 = JLINKARMROMTABLEADDRINDEX) -- Value=0xE00FF000 returns 0x00 (0000ms, 8374ms total) T05A4 12012:541 JLINKGetDebugInfo(0x101 = JLINKARMDEBUGINFOETMADDRINDEX) -- Value=0xE0041000 returns 0x00 (0000ms, 8374ms total) T05A4 12012:541 JLINKReadMemEx(0xE0041FD0, 0x0020 Bytes, ..., Flags = 0x02000004) -- CPUReadMem(32 bytes @ 0xE0041FD0) - Data: 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... returns 0x20 (0001ms, 8375ms total) T05A4 12012:542 JLINKGetDebugInfo(0x102 = JLINKARMDEBUGINFOMTBADDRINDEX) -- Value=0x00000000 returns 0x00 (0000ms, 8375ms total) T05A4 12012:542 JLINKGetDebugInfo(0x103 = JLINKARMDEBUGINFOTPIUADDRINDEX) -- Value=0xE0040000 returns 0x00 (0000ms, 8375ms total) T05A4 12012:542 JLINKGetDebugInfo(0x104 = JLINKARMDEBUGINFOITMADDRINDEX) -- Value=0xE0000000 returns 0x00 (0000ms, 8375ms total) T05A4 12012:542 JLINKGetDebugInfo(0x105 = JLINKARMDEBUGINFODWTADDRINDEX) -- Value=0xE0001000 returns 0x00 (0000ms, 8375ms total) T05A4 12012:542 JLINKGetDebugInfo(0x106 = JLINKARMDEBUGINFOFPBADDRINDEX) -- Value=0xE0002000 returns 0x00 (0000ms, 8375ms total) T05A4 12012:542 JLINKGetDebugInfo(0x107 = JLINKARMDEBUGINFONVICADDRINDEX) -- Value=0xE000E000 returns 0x00 (0000ms, 8375ms total) T05A4 12012:542 JLINKGetDebugInfo(0x10C = JLINKARMDEBUGINFODBGADDRINDEX) -- Value=0xE000EDF0 returns 0x00 (0000ms, 8375ms total) T05A4 12012:542 JLINKGetDebugInfo(0x01 = Unknown) -- Value=0x00000000 returns 0x00 (0000ms, 8375ms total) T05A4 12012:542 JLINKReadMemU32(0xE000ED00, 0x0001 Items, ...) -- CPUReadMem(4 bytes @ 0xE000ED00) - Data: 31 C2 1F 41 returns 0x01 (0000ms, 8375ms total) T05A4 12012:543 JLINKGetDebugInfo(0x10F = JLINKARMDEBUGINFOHASCORTEXMSECURITYEXTINDEX) -- Value=0x00000000 returns 0x00 (0000ms, 8375ms total) T05A4 12012:543 JLINKSetResetType(JLINKARMCM3RESETTYPENORMAL) returns JLINKARMCM3RESETTYPENORMAL (0000ms, 8375ms total) T05A4 12012:543 JLINKReset() -- CPU is running -- CPUWriteMem(4 bytes @ 0xE000EDF0) -- CPU is running -- CPUWriteMem(4 bytes @ 0xE000EDFC)Reset: Halt core after reset via DEMCR.VCCORERESET. >0x35 TIF>Reset: Reset device via AIRCR.SYSRESETREQ. -- CPU is running -- CPUWriteMem(4 bytes @ 0xE000ED0C) >0x0D TIF> >0x28 TIF> -- CPUReadMem(4 bytes @ 0xE000EDF0) -- CPUReadMem(4 bytes @ 0xE000EDF0) -- CPU is running -- CPUWriteMem(4 bytes @ 0xE000EDF0) -- CPU is running -- CPUWriteMem(4 bytes @ 0xE000EDFC) -- CPUReadMem(4 bytes @ 0xE000EDF0) -- CPUWriteMem(4 bytes @ 0xE0002000) -- CPUReadMem(4 bytes @ 0xE000EDFC) -- CPUReadMem(4 bytes @ 0xE0001000) (0081ms, 8456ms total) T05A4 12012:624 JLINKHalt() returns 0x00 (0000ms, 8456ms total) T05A4 12012:624 JLINKReadMemU32(0xE000EDF0, 0x0001 Items, ...) -- CPUReadMem(4 bytes @ 0xE000EDF0) - Data: 03 00 03 00 returns 0x01 (0001ms, 8457ms total) T05A4 12012:625 JLINKWriteU32(0xE000EDF0, 0xA05F0003) -- CPUWriteMem(4 bytes @ 0xE000EDF0) returns 0x00 (0000ms, 8457ms total) T05A4 12012:625 JLINKWriteU32(0xE000EDFC, 0x01000000) -- CPUWriteMem(4 bytes @ 0xE000EDFC) returns 0x00 (0000ms, 8457ms total) T05A4 12012:647 JLINKGetHWStatus(...) returns 0x00 (0000ms, 8457ms total) T05A4 12012:662 JLINKGetNumBPUnits(Type = 0xFFFFFF00) returns 0x06 (0000ms, 8457ms total) T05A4 12012:662 JLINKGetNumBPUnits(Type = 0xF0) returns 0x2000 (0000ms, 8457ms total) T05A4 12012:662 JLINKGetNumWPUnits() returns 0x04 (0000ms, 8457ms total) T05A4 12012:676 JLINKGetSpeed() returns 0xFA0 (0000ms, 8457ms total) T05A4 12012:684 JLINKReadMemU32(0xE000E004, 0x0001 Items, ...) -- CPUReadMem(4 bytes @ 0xE000E004) - Data: 01 00 00 00 returns 0x01 (0000ms, 8457ms total) T05A4 12012:684 JLINKReadMemU32(0xE000E004, 0x0001 Items, ...) -- CPUReadMem(4 bytes @ 0xE000E004) - Data: 01 00 00 00 returns 0x01 (0001ms, 8458ms total) T05A4 12012:685 JLINKWriteMemEx(0xE0001000, 0x001C Bytes, ..., Flags = 0x02000004) - Data: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... -- CPUWriteMem(28 bytes @ 0xE0001000) returns 0x1C (0001ms, 8459ms total) T05A4 12012:686 JLINKHalt() returns 0x00 (0000ms, 8459ms total) T05A4 12012:686 JLINKIsHalted() returns TRUE (0000ms, 8459ms total) T05A4 12012:689 JLINKWriteMem(0x20000000, 0x0164 Bytes, ...) - Data: 00 BE 0A E0 0D 78 2D 06 68 40 08 24 40 00 00 D3 ... -- CPUWriteMem(356 bytes @ 0x20000000) returns 0x164 (0003ms, 8462ms total) T05A4 12012:692 JLINKWriteReg(R0, 0x08000000) returns 0x00 (0000ms, 8462ms total) T05A4 12012:692 JLINKWriteReg(R1, 0x044AA200) returns 0x00 (0000ms, 8462ms total) T05A4 12012:692 JLINKWriteReg(R2, 0x00000001) returns 0x00 (0000ms, 8462ms total) T05A4 12012:692 JLINKWriteReg(R3, 0x00000000) returns 0x00 (0000ms, 8462ms total) T05A4 12012:692 JLINKWriteReg(R4, 0x00000000) returns 0x00 (0000ms, 8462ms total) T05A4 12012:692 JLINKWriteReg(R5, 0x00000000) returns 0x00 (0000ms, 8462ms total) T05A4 12012:692 JLINKWriteReg(R6, 0x00000000) returns 0x00 (0000ms, 8462ms total) T05A4 12012:692 JLINKWriteReg(R7, 0x00000000) returns 0x00 (0000ms, 8462ms total) T05A4 12012:692 JLINKWriteReg(R8, 0x00000000) returns 0x00 (0000ms, 8462ms total) T05A4 12012:692 JLINKWriteReg(R9, 0x20000160) returns 0x00 (0000ms, 8462ms total) T05A4 12012:692 JLINKWriteReg(R10, 0x00000000) returns 0x00 (0000ms, 8462ms total) T05A4 12012:692 JLINKWriteReg(R11, 0x00000000) returns 0x00 (0000ms, 8462ms total) T05A4 12012:692 JLINKWriteReg(R12, 0x00000000) returns 0x00 (0000ms, 8462ms total) T05A4 12012:692 JLINKWriteReg(R13 (SP), 0x20001000) returns 0x00 (0000ms, 8462ms total) T05A4 12012:692 JLINKWriteReg(R14, 0x20000001) returns 0x00 (0000ms, 8462ms total) T05A4 12012:692 JLINKWriteReg(R15 (PC), 0x20000038) returns 0x00 (0000ms, 8462ms total) T05A4 12012:692 JLINKWriteReg(XPSR, 0x01000000) returns 0x00 (0000ms, 8462ms total) T05A4 12012:692 JLINKWriteReg(MSP, 0x20001000) returns 0x00 (0000ms, 8462ms total) T05A4 12012:692 JLINKWriteReg(PSP, 0x20001000) returns 0x00 (0000ms, 8462ms total) T05A4 12012:692 JLINKWriteReg(CFBP, 0x00000000) returns 0x00 (0000ms, 8462ms total) T05A4 12012:692 JLINKSetBPEx(Addr = 0x20000000, Type = 0xFFFFFFF2) -- CPUReadMem(2 bytes @ 0x20000000) returns 0x00000001 (0001ms, 8463ms total) T05A4 12012:693 JLINKGo() -- CPUWriteMem(2 bytes @ 0x20000000) -- CPUReadMem(4 bytes @ 0xE0001000) -- CPUWriteMem(4 bytes @ 0xE0002008) -- CPUWriteMem(4 bytes @ 0xE000200C) -- CPUWriteMem(4 bytes @ 0xE0002010) -- CPUWriteMem(4 bytes @ 0xE0002014) -- CPUWriteMem(4 bytes @ 0xE0002018) -- CPUWriteMem(4 bytes @ 0xE000201C) -- CPUWriteMem(4 bytes @ 0xE0001004) (0003ms, 8466ms total) T05A4 12012:696 JLINKIsHalted() -- CPUReadMem(2 bytes @ 0x20000000) returns TRUE (0003ms, 8469ms total) T05A4 12012:699 JLINKReadReg(R15 (PC)) returns 0x20000000 (0000ms, 8466ms total) T05A4 12012:699 JLINKClrBPEx(BPHandle = 0x00000001) returns 0x00 (0000ms, 8466ms total) T05A4 12012:699 JLINKReadReg(R0) returns 0x00000000 (0000ms, 8466ms total) T05A4 12012:700 JLINKWriteReg(R0, 0x08000000) returns 0x00 (0000ms, 8466ms total) T05A4 12012:700 JLINKWriteReg(R1, 0x00000800) returns 0x00 (0000ms, 8466ms total) T05A4 12012:700 JLINKWriteReg(R2, 0x000000FF) returns 0x00 (0000ms, 8466ms total) T05A4 12012:700 JLINKWriteReg(R3, 0x00000000) returns 0x00 (0000ms, 8466ms total) T05A4 12012:700 JLINKWriteReg(R4, 0x00000000) returns 0x00 (0000ms, 8466ms total) T05A4 12012:700 JLINKWriteReg(R5, 0x00000000) returns 0x00 (0000ms, 8466ms total) T05A4 12012:700 JLINKWriteReg(R6, 0x00000000) returns 0x00 (0000ms, 8466ms total) T05A4 12012:700 JLINKWriteReg(R7, 0x00000000) returns 0x00 (0000ms, 8466ms total) T05A4 12012:700 JLINKWriteReg(R8, 0x00000000) returns 0x00 (0000ms, 8466ms total) T05A4 12012:700 JLINKWriteReg(R9, 0x20000160) returns 0x00 (0000ms, 8466ms total) T05A4 12012:700 JLINKWriteReg(R10, 0x00000000) returns 0x00 (0000ms, 8466ms total) T05A4 12012:700 JLINKWriteReg(R11, 0x00000000) returns 0x00 (0000ms, 8466ms total) T05A4 12012:700 JLINKWriteReg(R12, 0x00000000) returns 0x00 (0000ms, 8466ms total) T05A4 12012:700 JLINKWriteReg(R13 (SP), 0x20001000) returns 0x00 (0000ms, 8466ms total) T05A4 12012:700 JLINKWriteReg(R14, 0x20000001) returns 0x00 (0000ms, 8466ms total) T05A4 12012:700 JLINKWriteReg(R15 (PC), 0x20000020) returns 0x00 (0000ms, 8466ms total) T05A4 12012:700 JLINKWriteReg(XPSR, 0x01000000) returns 0x00 (0000ms, 8466ms total) T05A4 12012:700 JLINKWriteReg(MSP, 0x20001000) returns 0x00 (0000ms, 8466ms total) T05A4 12012:700 JLINKWriteReg(PSP, 0x20001000) returns 0x00 (0000ms, 8466ms total) T05A4 12012:700 JLINKWriteReg(CFBP, 0x00000000) returns 0x00 (0000ms, 8466ms total) T05A4 12012:700 JLINKSetBPEx(Addr = 0x20000000, Type = 0xFFFFFFF2) returns 0x00000002 (0000ms, 8466ms total) T05A4 12012:700 JLINKGo() -- CPUReadMem(4 bytes @ 0xE0001000) (0002ms, 8468ms total) T05A4 12012:702 JLINKIsHalted() -- CPUReadMem(2 bytes @ 0x20000000) returns TRUE (0002ms, 8470ms total) T05A4 12012:704 JLINKReadReg(R15 (PC)) returns 0x20000000 (0000ms, 8468ms total) T05A4 12012:704 JLINKClrBPEx(BPHandle = 0x00000002) returns 0x00 (0000ms, 8468ms total) T05A4 12012:704 JLINKReadReg(R0) returns 0x00000001 (0000ms, 8468ms total) T05A4 12012:704 JLINKWriteReg(R0, 0x08000000) returns 0x00 (0000ms, 8468ms total) T05A4 12012:704 JLINKWriteReg(R1, 0x00000800) returns 0x00 (0000ms, 8468ms total) T05A4 12012:704 JLINKWriteReg(R2, 0x000000FF) returns 0x00 (0000ms, 8468ms total) T05A4 12012:704 JLINKWriteReg(R3, 0x00000000) returns 0x00 (0000ms, 8468ms total) T05A4 12012:704 JLINKWriteReg(R4, 0x00000000) returns 0x00 (0000ms, 8468ms total) T05A4 12012:704 JLINKWriteReg(R5, 0x00000000) returns 0x00 (0000ms, 8468ms total) T05A4 12012:704 JLINKWriteReg(R6, 0x00000000) returns 0x00 (0000ms, 8468ms total) T05A4 12012:704 JLINKWriteReg(R7, 0x00000000) returns 0x00 (0000ms, 8468ms total) T05A4 12012:704 JLINKWriteReg(R8, 0x00000000) returns 0x00 (0000ms, 8468ms total) T05A4 12012:704 JLINKWriteReg(R9, 0x20000160) returns 0x00 (0000ms, 8468ms total) T05A4 12012:704 JLINKWriteReg(R10, 0x00000000) returns 0x00 (0000ms, 8468ms total) T05A4 12012:704 JLINKWriteReg(R11, 0x00000000) returns 0x00 (0000ms, 8468ms total) T05A4 12012:704 JLINKWriteReg(R12, 0x00000000) returns 0x00 (0000ms, 8468ms total) T05A4 12012:704 JLINKWriteReg(R13 (SP), 0x20001000) returns 0x00 (0000ms, 8468ms total) T05A4 12012:705 JLINKWriteReg(R14, 0x20000001) returns 0x00 (0000ms, 8469ms total) T05A4 12012:705 JLINKWriteReg(R15 (PC), 0x200000B6) returns 0x00 (0000ms, 8469ms total) T05A4 12012:705 JLINKWriteReg(XPSR, 0x01000000) returns 0x00 (0000ms, 8469ms total) T05A4 12012:705 JLINKWriteReg(MSP, 0x20001000) returns 0x00 (0000ms, 8469ms total) T05A4 12012:705 JLINKWriteReg(PSP, 0x20001000) returns 0x00 (0000ms, 8469ms total) T05A4 12012:705 JLINKWriteReg(CFBP, 0x00000000) returns 0x00 (0000ms, 8469ms total) T05A4 12012:705 JLINKSetBPEx(Addr = 0x20000000, Type = 0xFFFFFFF2) returns 0x00000003 (0000ms, 8469ms total) T05A4 12012:705 JLINKGo() -- CPUReadMem(4 bytes @ 0xE0001000) (0001ms, 8470ms total) T05A4 12012:706 JLINKIsHalted() returns FALSE (0000ms, 8470ms total) T05A4 12012:818 JLINKIsHalted() -- CPUReadMem(2 bytes @ 0x20000000) returns TRUE (0002ms, 8472ms total) T05A4 12012:820 JLINKReadReg(R15 (PC)) returns 0x20000000 (0000ms, 8470ms total) T05A4 12012:820 JLINKClrBPEx(BPHandle = 0x00000003) returns 0x00 (0000ms, 8470ms total) T05A4 12012:820 JLINKReadReg(R0) returns 0x00000000 (0000ms, 8470ms total) T05A4 12012:821 JLINKWriteReg(R0, 0x08000800) returns 0x00 (0000ms, 8470ms total) T05A4 12012:821 JLINKWriteReg(R1, 0x00000800) returns 0x00 (0000ms, 8470ms total) T05A4 12012:821 JLINKWriteReg(R2, 0x000000FF) returns 0x00 (0000ms, 8470ms total) T05A4 12012:821 JLINKWriteReg(R3, 0x00000000) returns 0x00 (0000ms, 8470ms total) T05A4 12012:821 JLINKWriteReg(R4, 0x00000000) returns 0x00 (0000ms, 8470ms total) T05A4 12012:821 JLINKWriteReg(R5, 0x00000000) returns 0x00 (0000ms, 8470ms total) T05A4 12012:821 JLINKWriteReg(R6, 0x00000000) returns 0x00 (0000ms, 8470ms total) T05A4 12012:821 JLINKWriteReg(R7, 0x00000000) returns 0x00 (0000ms, 8470ms total) T05A4 12012:821 JLINKWriteReg(R8, 0x00000000) returns 0x00 (0000ms, 8470ms total) T05A4 12012:821 JLINKWriteReg(R9, 0x20000160) returns 0x00 (0000ms, 8470ms total) T05A4 12012:821 JLINKWriteReg(R10, 0x00000000) returns 0x00 (0000ms, 8470ms total) T05A4 12012:821 JLINKWriteReg(R11, 0x00000000) returns 0x00 (0000ms, 8470ms total) T05A4 12012:821 JLINK_WriteReg(R12, 0x00000000) return
RTE_Components.h
/ Auto generated Run-Time-Environment Component Configuration File Do not modify ! Project: 'MINIPI2CUART' Target: 'MINIPI2CUART' */
#ifndef RTECOMPONENTSH #define RTECOMPONENTSH
/*
* Define the Device Header File:
*/
#define CMSIS_device_header "stm32f10x.h"#define RTECompilerIOSTDOUT / Compiler I/O: STDOUT / #define RTECompilerIOSTDOUT_User / Compiler I/O: STDOUT User /
#endif / RTECOMPONENTSH /
dma.c
/ File Name : dma.c Description : This file provides code for the configuration of all the requested memory to memory DMA transfers. ** This notice applies to any and all portions of this file that are not between comment pairs USER CODE BEGIN and USER CODE END. Other portions of this file, whether inserted by the user or by software development tools are owned by their respective copyright owners. Copyright (c) 2019 STMicroelectronics I
Use and verification
The technical content follows the readable source material. Confirm the product hardware revision, flight-stack or software version, and field safety boundary against the original material and current platform documentation.
Materials and downloads
- ****************************************************************************** · English source (ZIP)Complete inquiry to download
