mirror of
https://github.com/yoboujon/dumber.git
synced 2025-06-08 22:00:49 +02:00
Compare commits
2 commits
evoxx-dumb
...
DUMBER-3_v
Author | SHA1 | Date | |
---|---|---|---|
![]() |
bbc6c85192 | ||
![]() |
1d1b2a7e52 |
14 changed files with 341 additions and 39 deletions
16
.gitignore
vendored
16
.gitignore
vendored
|
@ -54,6 +54,19 @@ GUI
|
|||
*.7z
|
||||
*.rar
|
||||
|
||||
# Images
|
||||
*.jpg
|
||||
*.png
|
||||
*.gif
|
||||
*.bmp
|
||||
*.jpeg
|
||||
*.tiff
|
||||
*.svg
|
||||
|
||||
# Documents
|
||||
*.pdf
|
||||
*.chm
|
||||
|
||||
# Trucs de MDK
|
||||
*.uvgui*
|
||||
*.bak
|
||||
|
@ -70,4 +83,7 @@ GUI
|
|||
/software/dumber3/Tests/
|
||||
/software/dumber3/workspace/
|
||||
|
||||
/hardware/meca/Dumber_2022/Pieces/
|
||||
/hardware/meca/Dumber_2022/OldVersions/
|
||||
|
||||
/doc/Doc\ robot/doxygen/
|
||||
|
|
BIN
hardware/meca/Dumber_2022/Dumber_2022_git.ipj
Normal file
BIN
hardware/meca/Dumber_2022/Dumber_2022_git.ipj
Normal file
Binary file not shown.
|
@ -22,6 +22,7 @@
|
|||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.1508870668" name="Core" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" useByScannerDiscovery="false" value="0" valueType="string"/>
|
||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.475855176" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="genericBoard" valueType="string"/>
|
||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.802392362" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.5 || Debug || true || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32L071CBTx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Middlewares/Third_Party/FreeRTOS/Source/include | ../Drivers/CMSIS/Include | ../Core/Inc | ../Drivers/STM32L0xx_HAL_Driver/Inc | ../Drivers/CMSIS/Device/ST/STM32L0xx/Include | ../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy | ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 | ../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM0 || || || USE_HAL_DRIVER | STM32L010x6 || || Drivers | Core/Startup | Middlewares | Core || || || ${workspace_loc:/${ProjName}/STM32L071CBTx_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || " valueType="string"/>
|
||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.runtimelibrary_c.1064254422" name="Runtime library" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.runtimelibrary_c" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.runtimelibrary_c.value.nano_c" valueType="enumerated"/>
|
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.1582271634" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
|
||||
<builder buildPath="${workspace_loc:/Dumber3}/Debug" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1329460993" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
|
||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.635805233" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
|
||||
|
@ -33,7 +34,7 @@
|
|||
</tool>
|
||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1474341646" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler">
|
||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.620486962" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g3" valueType="enumerated"/>
|
||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.2040942504" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.o2" valueType="enumerated"/>
|
||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.2040942504" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.o0" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.1441075970" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="DEBUG"/>
|
||||
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
|
||||
|
|
|
@ -35,6 +35,10 @@
|
|||
* Robot is basically controlled by a supervisor program and move depending on commands send by supervisor.
|
||||
* Movements are controlled by a camera.
|
||||
*
|
||||
* @warning Very important information: robot is use a 2.5V power supply so
|
||||
* XBEE MODULES FROM S1 GENERATION DON'T WORK
|
||||
* Use, at least, module from S2 generation
|
||||
*
|
||||
* @copyright Copyright 2023 INSA-GEI, Toulouse, France. All rights reserved.
|
||||
* @copyright This project is released under the Lesser GNU Public License (LGPL-3.0-only).
|
||||
*
|
||||
|
@ -66,6 +70,7 @@
|
|||
#include "battery.h"
|
||||
|
||||
#include "panic.h"
|
||||
#include "rtos_support.h"
|
||||
|
||||
/** @addtogroup Application_Software
|
||||
* @{
|
||||
|
@ -123,7 +128,7 @@ StaticTask_t xTaskApplicationMain;
|
|||
/* Buffer that the task being created will use as its stack. Note this is
|
||||
an array of StackType_t variables. The size of StackType_t is dependent on
|
||||
the RTOS port. */
|
||||
StackType_t xStackApplicationMain[ STACK_SIZE ];
|
||||
StackType_t xStackApplicationMain[ STACK_SIZE*2 ];
|
||||
TaskHandle_t xHandleApplicationMain = NULL;
|
||||
|
||||
StaticTimer_t xBufferTimerTimeout;
|
||||
|
@ -144,6 +149,9 @@ APPLICATION_Timeout systemTimeout = {0};
|
|||
* @return None
|
||||
*/
|
||||
void APPLICATION_Init(void) {
|
||||
/* Init du support RTOS (notamment le timer de run time) */
|
||||
//RTOS_SUPPORT_Init(); /* <- used for freertos run time usage */
|
||||
|
||||
/* Init des messages box */
|
||||
MESSAGE_Init();
|
||||
|
||||
|
@ -159,7 +167,7 @@ void APPLICATION_Init(void) {
|
|||
xHandleApplicationMain = xTaskCreateStatic(
|
||||
APPLICATION_Thread, /* Function that implements the task. */
|
||||
"APPLICATION Thread", /* Text name for the task. */
|
||||
STACK_SIZE, /* Number of indexes in the xStack array. */
|
||||
STACK_SIZE*2, /* Number of indexes in the xStack array. */
|
||||
NULL, /* Parameter passed into the task. */
|
||||
PriorityApplicationHandler,/* Priority at which the task is created. */
|
||||
xStackApplicationMain, /* Array to use as the task's stack. */
|
||||
|
@ -216,6 +224,7 @@ void APPLICATION_Thread(void* params) {
|
|||
case CMD_TEST:
|
||||
case CMD_DEBUG:
|
||||
cmdSendAnswer(ANS_OK);
|
||||
break;
|
||||
case CMD_POWER_OFF:
|
||||
systemInfos.powerOffRequired=1;
|
||||
cmdSendAnswer(ANS_OK);
|
||||
|
@ -405,10 +414,15 @@ void APPLICATION_StateMachine(void) {
|
|||
if (((systemInfos.cmd == CMD_MOVE) && (systemInfos.distance !=0)) ||
|
||||
((systemInfos.cmd == CMD_TURN) && (systemInfos.turns !=0))) {
|
||||
systemInfos.endOfMouvement = 0;
|
||||
cmdSendAnswer(ANS_OK);
|
||||
APPLICATION_TransitionToNewState(stateInMouvement);
|
||||
} // if TURN and MOVE are sent without parameter, do nothing: we are still in run state
|
||||
} else if (systemInfos.state == stateInMouvement) { // in this state, MOVE and TURN cmds are accepted only if they come with no parameter
|
||||
} else {
|
||||
if (((systemInfos.cmd == CMD_MOVE) && (systemInfos.distance ==0)) || // This case (M=0 or T=0) correspond to STOP
|
||||
((systemInfos.cmd == CMD_TURN) && (systemInfos.turns ==0))) {
|
||||
systemInfos.endOfMouvement = 1;
|
||||
}
|
||||
}
|
||||
cmdSendAnswer(ANS_OK);
|
||||
} else if (systemInfos.state == stateInMouvement) { // in this state, MOVE and TURN cmds are accepted only if they come with no parameter (0)
|
||||
if (((systemInfos.cmd == CMD_MOVE) && (systemInfos.distance ==0)) ||
|
||||
((systemInfos.cmd == CMD_TURN) && (systemInfos.turns ==0))) {
|
||||
systemInfos.endOfMouvement = 1;
|
||||
|
|
|
@ -41,6 +41,8 @@
|
|||
#include "xbee.h"
|
||||
#include "commands.h"
|
||||
|
||||
#include "rtos_support.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
/** @addtogroup Application_Software
|
||||
|
|
|
@ -44,11 +44,11 @@
|
|||
* Version in plain text and as a numeric value
|
||||
*/
|
||||
///@{
|
||||
#define SYSTEM_VERSION_STR "2.1"
|
||||
#define SYSTEM_VERSION 0x0201 // Upper byte: major version, lower byte: minor version
|
||||
#define SYSTEM_VERSION_STR "2.3"
|
||||
#define SYSTEM_VERSION 0x0203 // Upper byte: major version, lower byte: minor version
|
||||
///@}
|
||||
|
||||
#define STACK_SIZE 0x100
|
||||
#define STACK_SIZE 64
|
||||
|
||||
/** @name Tasks priority constants
|
||||
* Priority is based on configMAX_PRIORITIES which represent highest task priority.
|
||||
|
|
|
@ -62,6 +62,12 @@ void MESSAGE_Init(void) {
|
|||
MOTORS_Mailbox = xQueueCreate(QUEUE_SIZE, sizeof(MESSAGE_Typedef));
|
||||
APPLICATION_Mailbox = xQueueCreate(QUEUE_SIZE, sizeof(MESSAGE_Typedef));
|
||||
XBEE_Mailbox = xQueueCreate(QUEUE_SIZE, sizeof(MESSAGE_Typedef));
|
||||
|
||||
/* Add queues to registry in order to view them in stm32cube ide */
|
||||
vQueueAddToRegistry(LEDS_Mailbox,"LEDS Mailbox");
|
||||
vQueueAddToRegistry(MOTORS_Mailbox,"MOTORS Mailbox");
|
||||
vQueueAddToRegistry(APPLICATION_Mailbox,"APPLICATION Mailbox");
|
||||
vQueueAddToRegistry(XBEE_Mailbox,"XBEE Mailbox");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
115
software/dumber3/Application/rtos_support.c
Normal file
115
software/dumber3/Application/rtos_support.c
Normal file
|
@ -0,0 +1,115 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file motors.c
|
||||
* @brief motors driver body
|
||||
* @author S. DI MERCURIO (dimercur@insa-toulouse.fr)
|
||||
* @date December 2023
|
||||
*
|
||||
******************************************************************************
|
||||
* @copyright Copyright 2023 INSA-GEI, Toulouse, France. All rights reserved.
|
||||
* @copyright This project is released under the Lesser GNU Public License (LGPL-3.0-only).
|
||||
*
|
||||
* @copyright This file is part of "Dumber" project
|
||||
*
|
||||
* @copyright This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright This program 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. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
|
||||
* @copyright You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "rtos_support.h"
|
||||
|
||||
#include "stm32l0xx_ll_tim.h"
|
||||
|
||||
/** @addtogroup Application_Software
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup RTOS_SUPPORT
|
||||
* RTOS support module provide several functions for task run time measurement.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup RTOS_SUPPORT_Private Private
|
||||
* @{
|
||||
*/
|
||||
|
||||
uint16_t RTOS_SUPPORT_counter16bitUpper=0;
|
||||
|
||||
/**
|
||||
* @brief TIM7 Initialization Function
|
||||
*/
|
||||
void RTOS_SUPPORT_Init(void) {
|
||||
TIM_ClockConfigTypeDef sClockSourceConfig = { 0 };
|
||||
TIM_HandleTypeDef htim7;
|
||||
|
||||
__HAL_RCC_TIM7_CLK_ENABLE();
|
||||
|
||||
htim7.Instance = TIM7;
|
||||
htim7.Init.Prescaler = 0;
|
||||
htim7.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim7.Init.Period = 65535;
|
||||
htim7.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
htim7.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
if (HAL_TIM_Base_Init(&htim7) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
|
||||
if (HAL_TIM_ConfigClockSource(&htim7, &sClockSourceConfig) != HAL_OK) {
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/* TIM7 interrupt Init */
|
||||
LL_TIM_EnableIT_UPDATE(TIM7);
|
||||
HAL_NVIC_SetPriority(TIM7_IRQn, 1, 0);
|
||||
HAL_NVIC_EnableIRQ(TIM7_IRQn);
|
||||
|
||||
RTOS_SUPPORT_counter16bitUpper=0;
|
||||
LL_TIM_EnableCounter(TIM7);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get 32bit emulated timer based on TIM7
|
||||
*
|
||||
* @return 32bit timer
|
||||
*/
|
||||
uint32_t RTOS_SUPPORT_GetTimer(void) {
|
||||
|
||||
uint16_t currentVal=LL_TIM_GetCounter(TIM7);
|
||||
|
||||
return (uint32_t)((((uint32_t)RTOS_SUPPORT_counter16bitUpper)<<16) + (uint32_t)currentVal);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles TIM7 update interrupt for 32bit
|
||||
*/
|
||||
void TIM7_IRQHandler(void) {
|
||||
LL_TIM_ClearFlag_UPDATE(TIM7);
|
||||
|
||||
RTOS_SUPPORT_counter16bitUpper++;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
40
software/dumber3/Application/rtos_support.h
Normal file
40
software/dumber3/Application/rtos_support.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* rtos_support.h
|
||||
*
|
||||
* Created on: Jan 12, 2024
|
||||
* Author: dimercur
|
||||
*/
|
||||
|
||||
#ifndef RTOS_SUPPORT_H_
|
||||
#define RTOS_SUPPORT_H_
|
||||
|
||||
#include "application.h"
|
||||
|
||||
/** @addtogroup Application_Software
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup RTOS_SUPPORT
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup RTOS_SUPPORT_Public Public
|
||||
* @{
|
||||
*/
|
||||
|
||||
void RTOS_SUPPORT_Init(void);
|
||||
uint32_t RTOS_SUPPORT_GetTimer(void);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* RTOS_SUPPORT_H_ */
|
|
@ -40,6 +40,11 @@
|
|||
|
||||
/** @addtogroup XBEE
|
||||
* Xbee driver handles RF communications with supervisor
|
||||
*
|
||||
* @warning Very important information: robot is use a 2.5V power supply so
|
||||
* XBEE MODULES FROM S1 GENERATION DON'T WORK
|
||||
* Use, at least, module from S2 generation
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
@ -98,7 +103,6 @@ StackType_t xStackXbeeRX[ STACK_SIZE ];
|
|||
TaskHandle_t xHandleXbeeRX = NULL;
|
||||
|
||||
uint8_t rxBuffer[XBEE_RX_BUFFER_MAX_LENGTH]={0};
|
||||
//uint8_t rxWaitForACK =0;
|
||||
uint8_t rxPhase;
|
||||
uint16_t rxCmdLength;
|
||||
uint16_t rxDataToReceive;
|
||||
|
@ -110,9 +114,7 @@ uint16_t rxIndex;
|
|||
|
||||
/****** TX part ******/
|
||||
SemaphoreHandle_t xHandleSemaphoreTX = NULL;
|
||||
//SemaphoreHandle_t xHandleSemaphoreTX_ACK = NULL;
|
||||
StaticSemaphore_t xSemaphoreTX;
|
||||
//StaticSemaphore_t xSemaphoreTX_ACK;
|
||||
|
||||
/**
|
||||
* @brief Function for initializing xbee system
|
||||
|
@ -122,12 +124,14 @@ StaticSemaphore_t xSemaphoreTX;
|
|||
*/
|
||||
void XBEE_Init(void) {
|
||||
xHandleSemaphoreTX = xSemaphoreCreateBinaryStatic( &xSemaphoreTX );
|
||||
//xHandleSemaphoreTX_ACK = xSemaphoreCreateBinaryStatic( &xSemaphoreTX_ACK );
|
||||
xSemaphoreGive(xHandleSemaphoreTX);
|
||||
//xSemaphoreTake(xHandleSemaphoreTX_ACK);
|
||||
|
||||
xHandleSemaphoreRX = xSemaphoreCreateBinaryStatic( &xSemaphoreRx );
|
||||
|
||||
/* Add semaphores to registry in order to view them in stm32cube ide */
|
||||
vQueueAddToRegistry(xHandleSemaphoreTX,"XBEE TX sem");
|
||||
vQueueAddToRegistry(xHandleSemaphoreRX,"XBEE RX sem");
|
||||
|
||||
/* Create the task without using any dynamic memory allocation. */
|
||||
xHandleXbeeRX = xTaskCreateStatic(
|
||||
XBEE_RxThread, /* Function that implements the task. */
|
||||
|
@ -204,10 +208,6 @@ int XBEE_SendData(char* data) {
|
|||
if answer is false, it means timeout appends
|
||||
We should probably reset something in "else" branch */
|
||||
|
||||
// while (LL_USART_IsEnabledIT_TXE(hlpuart1.Instance)) {
|
||||
// vTaskDelay(pdMS_TO_TICKS(1));
|
||||
// }
|
||||
|
||||
strncpy((char*)txBuffer,data,XBEE_TX_BUFFER_MAX_LENGTH-1);
|
||||
txBuffer[XBEE_TX_BUFFER_MAX_LENGTH-1]=0;
|
||||
txRemainingData = strlen((char*)txBuffer);
|
||||
|
@ -261,6 +261,12 @@ void XBEE_TX_IRQHandler(void) {
|
|||
*
|
||||
* Wait for incoming message and send them to application mailbox
|
||||
*
|
||||
* @warning Very important information: robot is use a 2.5V power supply so
|
||||
* XBEE MODULES FROM S1 GENERATION DON'T WORK
|
||||
* Use, at least, module from S2 generation
|
||||
* Behavior of using S1 generation is that you receive only two '0' chars than nothing. In
|
||||
* case of this behavior, check module generation
|
||||
*
|
||||
* @param[in] params Initial task parameters
|
||||
* @return None
|
||||
*/
|
||||
|
@ -298,6 +304,12 @@ void XBEE_RxThread(void* params) {
|
|||
* This ISR is called when USART reception register is full, containing a newly received char
|
||||
* A Semaphore is used to signal end of frame reception to \ref XBEE_RxThread function
|
||||
*
|
||||
* @warning Very important information: robot is use a 2.5V power supply so
|
||||
* XBEE MODULES FROM S1 GENERATION DON'T WORK
|
||||
* Use, at least, module from S2 generation
|
||||
* Behavior of using S1 generation is that you receive only two '0' chars than nothing. In
|
||||
* case of this behavior, check module generation
|
||||
*
|
||||
* @param None
|
||||
* @return None
|
||||
*/
|
||||
|
@ -306,6 +318,11 @@ void XBEE_RX_IRQHandler(void) {
|
|||
uint8_t data;
|
||||
|
||||
data = LL_USART_ReceiveData8(hlpuart1.Instance); // lecture de l'octet reçu
|
||||
/*
|
||||
* In case you only receive '0' chars (than nothing), check you XBEE module generation
|
||||
* XBEE MODULES FROM S1 GENERATION DON'T WORK because robot is 2.5V and modules need more
|
||||
* Use, at least, module from S2 generation
|
||||
*/
|
||||
|
||||
if (data != XBEE_ENDING_CHAR) { // end of command not received
|
||||
rxBuffer[rxIndex] = data;
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
#ifndef FREERTOS_CONFIG_H
|
||||
#define FREERTOS_CONFIG_H
|
||||
|
||||
extern void RTOS_SUPPORT_Init(void);
|
||||
extern uint32_t RTOS_SUPPORT_GetTimer(void);
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
* Application specific definitions.
|
||||
*
|
||||
|
@ -62,9 +65,9 @@
|
|||
#define configUSE_TICK_HOOK 0
|
||||
#define configCPU_CLOCK_HZ ( SystemCoreClock )
|
||||
#define configTICK_RATE_HZ ((TickType_t)1000)
|
||||
#define configMAX_PRIORITIES ( 56 )
|
||||
#define configMAX_PRIORITIES ( 12 )
|
||||
#define configMINIMAL_STACK_SIZE ((uint16_t)128)
|
||||
#define configTOTAL_HEAP_SIZE ((size_t)1024)
|
||||
#define configTOTAL_HEAP_SIZE ((size_t)10240)
|
||||
#define configMAX_TASK_NAME_LEN ( 25 )
|
||||
#define configUSE_TRACE_FACILITY 1
|
||||
#define configUSE_16_BIT_TICKS 0
|
||||
|
@ -82,13 +85,13 @@
|
|||
|
||||
/* Co-routine definitions. */
|
||||
#define configUSE_CO_ROUTINES 0
|
||||
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
|
||||
#define configMAX_CO_ROUTINE_PRIORITIES ( 1 )
|
||||
|
||||
/* Software timer definitions. */
|
||||
#define configUSE_TIMERS 1
|
||||
#define configTIMER_TASK_PRIORITY ( 3 )
|
||||
#define configTIMER_TASK_PRIORITY ( 1 )
|
||||
#define configTIMER_QUEUE_LENGTH 10
|
||||
#define configTIMER_TASK_STACK_DEPTH 256
|
||||
#define configTIMER_TASK_STACK_DEPTH 64
|
||||
|
||||
/* The following flag must be enabled only when using newlib */
|
||||
#define configUSE_NEWLIB_REENTRANT 1
|
||||
|
@ -152,4 +155,8 @@ placed into the low power state respectively. */
|
|||
#define configPOST_SLEEP_PROCESSING PostSleepProcessing
|
||||
#endif /* configUSE_TICKLESS_IDLE == 1 */
|
||||
|
||||
#define configGENERATE_RUN_TIME_STATS 1
|
||||
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() RTOS_SUPPORT_Init()
|
||||
#define portGET_RUN_TIME_COUNTER_VALUE() RTOS_SUPPORT_GetTimer()
|
||||
|
||||
#endif /* FREERTOS_CONFIG_H */
|
||||
|
|
|
@ -55,12 +55,12 @@ TIM_HandleTypeDef htim3;
|
|||
TIM_HandleTypeDef htim21;
|
||||
|
||||
/* Definitions for defaultTask */
|
||||
osThreadId_t defaultTaskHandle;
|
||||
const osThreadAttr_t defaultTask_attributes = {
|
||||
.name = "defaultTask",
|
||||
.stack_size = 128 * 4,
|
||||
.priority = (osPriority_t) osPriorityNormal,
|
||||
};
|
||||
//osThreadId_t defaultTaskHandle;
|
||||
//const osThreadAttr_t defaultTask_attributes = {
|
||||
// .name = "defaultTask",
|
||||
// .stack_size = 128 * 4,
|
||||
// .priority = (osPriority_t) osPriorityNormal,
|
||||
//};
|
||||
/* USER CODE BEGIN PV */
|
||||
|
||||
/* USER CODE END PV */
|
||||
|
@ -146,7 +146,7 @@ int main(void)
|
|||
|
||||
/* Create the thread(s) */
|
||||
/* creation of defaultTask */
|
||||
defaultTaskHandle = osThreadNew(StartDefaultTask, NULL, &defaultTask_attributes);
|
||||
//defaultTaskHandle = osThreadNew(StartDefaultTask, NULL, &defaultTask_attributes);
|
||||
|
||||
/* USER CODE BEGIN RTOS_THREADS */
|
||||
/* add threads, ... */
|
||||
|
@ -644,9 +644,9 @@ TickType_t msToTicks(TickType_t ms) {
|
|||
* @retval None
|
||||
*/
|
||||
/* USER CODE END Header_StartDefaultTask */
|
||||
void StartDefaultTask(void *argument)
|
||||
{
|
||||
/* USER CODE BEGIN 5 */
|
||||
//void StartDefaultTask(void *argument)
|
||||
//{
|
||||
// /* USER CODE BEGIN 5 */
|
||||
// LEDS_State state = leds_off;
|
||||
//
|
||||
// /* Infinite loop */
|
||||
|
@ -660,8 +660,13 @@ void StartDefaultTask(void *argument)
|
|||
//
|
||||
// vTaskDelay(pdMS_TO_TICKS(5000));
|
||||
// }
|
||||
/* USER CODE END 5 */
|
||||
}
|
||||
// /* USER CODE END 5 */
|
||||
//
|
||||
// while (1)
|
||||
// {
|
||||
// //vTaskDelay(pdMS_TO_TICKS(50));
|
||||
// }
|
||||
//}
|
||||
|
||||
/**
|
||||
* @brief Period elapsed callback in non blocking mode
|
||||
|
|
|
@ -35,10 +35,11 @@
|
|||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.exception.unaligned" value="false"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.haltonexception" value="true"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swd_mode" value="true"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swv_port" value="3344"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swv_port" value="61235"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swv_trace_hclk" value="16000000"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.useRemoteTarget" value="true"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.vector_table" value=""/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.verify_flash_download" value="true"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.openocd.CTI_ALLOW_HALT" value="false"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.openocd.CTI_SIGNAL_HALT" value="false"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.openocd.DBG_DEVICE_SHAREABLE_ALLOWED" value="false"/>
|
||||
|
@ -70,7 +71,7 @@
|
|||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.watchdog_config" value="enable"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkenable_rtos" value="true"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{"fVersion":1,"fItems":[{"fDisplayName":"Reset","fIsSuppressible":false,"fResetAttribute":"Software system reset","fResetStrategies":[{"fDisplayName":"Software system reset","fLaunchAttribute":"system_reset","fGdbCommands":["monitor reset\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Hardware reset","fLaunchAttribute":"hardware_reset","fGdbCommands":["monitor reset hardware\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Core reset","fLaunchAttribute":"core_reset","fGdbCommands":["monitor reset core\n"],"fCmdOptions":["-g"]},{"fDisplayName":"None","fLaunchAttribute":"no_reset","fGdbCommands":[],"fCmdOptions":["-g"]}],"fGdbCommandGroup":{"name":"Additional commands","commands":[]},"fStartApplication":true}]}"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.enableRtosProxy" value="false"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.enableRtosProxy" value="true"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyCustomProperties" value=""/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriver" value="freertos"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriverAuto" value="false"/>
|
||||
|
@ -80,9 +81,9 @@
|
|||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="false"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value=""/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDeviceId" value="com.st.stm32cube.ide.mcu.debug.openocd"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDeviceId" value="com.st.stm32cube.ide.mcu.debug.stlink"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
|
||||
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="3333"/>
|
||||
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="61234"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value=""/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="true"/>
|
||||
|
|
78
software/robot/robot Release.launch
Normal file
78
software/robot/robot Release.launch
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="com.st.stm32cube.ide.mcu.debug.launch.launchConfigurationType">
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.access_port_id" value="0"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.cubeprog_external_loaders" value="[]"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.enable_live_expr" value="true"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.enable_swv" value="false"/>
|
||||
<intAttribute key="com.st.stm32cube.ide.mcu.debug.launch.formatVersion" value="2"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.ip_address_local" value="localhost"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.enabled" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.value" value=""/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.loadList" value="{"fItems":[{"fIsFromMainTab":true,"fPath":"Debug/robot.elf","fProjectName":"robot","fPerformBuild":true,"fDownload":true,"fLoadSymbols":true}]}"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.override_start_address_mode" value="default"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.remoteCommand" value="target remote"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startServer" value="true"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.exception.divby0" value="true"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.exception.unaligned" value="false"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.haltonexception" value="true"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swd_mode" value="true"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swv_port" value="61235"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swv_trace_hclk" value="16000000"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.useRemoteTarget" value="true"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.vector_table" value=""/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.verify_flash_download" value="true"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.cti_allow_halt" value="false"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.cti_signal_halt" value="false"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.enable_logging" value="false"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.enable_max_halt_delay" value="false"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.enable_shared_stlink" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.frequency" value="0"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.halt_all_on_reset" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.log_file" value="/home/dimercur/Travail/git/dumber/software/robot/Release/st-link_gdbserver_log.txt"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.low_power_debug" value="enable"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.max_halt_delay" value="2"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.reset_strategy" value="connect_under_reset"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_check_serial_number" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_txt_serial_number" value=""/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.watchdog_config" value="none"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkenable_rtos" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{"fVersion":1,"fItems":[{"fDisplayName":"Reset","fIsSuppressible":false,"fResetAttribute":"Software system reset","fResetStrategies":[{"fDisplayName":"Software system reset","fLaunchAttribute":"system_reset","fGdbCommands":["monitor reset\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Hardware reset","fLaunchAttribute":"hardware_reset","fGdbCommands":["monitor reset hardware\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Core reset","fLaunchAttribute":"core_reset","fGdbCommands":["monitor reset core\n"],"fCmdOptions":["-g"]},{"fDisplayName":"None","fLaunchAttribute":"no_reset","fGdbCommands":[],"fCmdOptions":["-g"]}],"fGdbCommandGroup":{"name":"Additional commands","commands":[]},"fStartApplication":true}]}"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.enableRtosProxy" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyCustomProperties" value=""/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriver" value="threadx"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriverAuto" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriverPort" value="cortex_m0"/>
|
||||
<intAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyPort" value="60000"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="false"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value=""/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDeviceId" value="com.st.stm32cube.ide.mcu.debug.stlink"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
|
||||
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="61234"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value=""/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
|
||||
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
|
||||
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="remote"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug/robot.elf"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="robot"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.412926795"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/robot"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="4"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><memoryBlockExpressionList context="reserved-for-future-use"/>"/>
|
||||
<stringAttribute key="process_factory_id" value="com.st.stm32cube.ide.mcu.debug.launch.HardwareDebugProcessFactory"/>
|
||||
</launchConfiguration>
|
Loading…
Add table
Reference in a new issue