Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bioloid_stm32_fw
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
humanoides
bioloid_stm32_fw
Commits
4bea0ec1
Commit
4bea0ec1
authored
9 years ago
by
Sergi Hernandez
Browse files
Options
Downloads
Patches
Plain Diff
Added support for the eeprom emmulation.
parent
758ae80f
No related branches found
No related tags found
No related merge requests found
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
Makefile
+3
-2
3 additions, 2 deletions
Makefile
include/eeprom.h
+35
-30
35 additions, 30 deletions
include/eeprom.h
linker_script/bioloid.ld
+0
-0
0 additions, 0 deletions
linker_script/bioloid.ld
src/bioloid_stm32.c
+3
-0
3 additions, 0 deletions
src/bioloid_stm32.c
src/eeprom.c
+311
-195
311 additions, 195 deletions
src/eeprom.c
with
352 additions
and
227 deletions
Makefile
+
3
−
2
View file @
4bea0ec1
...
...
@@ -7,6 +7,7 @@ TARGET_FILES=src/bioloid_stm32.c
TARGET_FILES
+=
src/system_stm32f4xx.c
TARGET_FILES
+=
src/stm32f4xx_hal_msp.c
TARGET_FILES
+=
src/gpio.c
TARGET_FILES
+=
src/eeprom.c
TARGET_FILES
+=
src/bioloid_time.c
TARGET_FILES
+=
src/bioloid_dyn_slave.c
TARGET_PROCESSOR
=
STM32F407VG
...
...
@@ -16,7 +17,7 @@ HAL_PATH=../../STM32_processor/hal/f4
include
$(HAL_PATH)/select_processor.mk
STM32_STARTUP_FILES_PATH
=
$(
HAL_PATH
)
/startup_code/
STM32_LINKER_SCRIPTS_PATH
=
$(
HAL_PATH
)
/linker_script
s
STM32_LINKER_SCRIPTS_PATH
=
.
/linker_script
UTILS_PATH
=
../../STM32_processor/libraries/utils
COMM_PATH
=
../../STM32_processor/libraries/comm
USART_PATH
=
../../STM32_processor/libraries/f4/usart
...
...
@@ -40,7 +41,7 @@ AS = $(TCHAIN_PREFIX)gcc
ASFLAGS
=
$(
COMPILE_OPTS
)
-c
LD
=
$(
TCHAIN_PREFIX
)
gcc
LDFLAGS
=
-mthumb
-mcpu
=
cortex-m4
-mfloat-abi
=
hard
-mfpu
=
fpv4-sp-d16
-Wl
,-Map
=
$@
.map,-cref
$(
INCLUDE_DIRS
)
-T
$(
STM32_LINKER_SCRIPTS_PATH
)
/
$(
LINKER_SCRIPT_FILE
)
--specs
=
nosys.specs
LDFLAGS
=
-mthumb
-mcpu
=
cortex-m4
-mfloat-abi
=
hard
-mfpu
=
fpv4-sp-d16
-Wl
,-Map
=
$@
.map,-cref
$(
INCLUDE_DIRS
)
-T
$(
STM32_LINKER_SCRIPTS_PATH
)
/
bioloid.ld
--specs
=
nosys.specs
EXT_LIB
=
$(
COMM_PATH
)
/lib/comm_m4_fpu.a
$(
UTILS_PATH
)
/lib/utils_m4_fpu.a
$(
DYNAMIXEL_PATH
)
/lib/dynamixel_m4_fpu.a
OBJCP
=
$(
TCHAIN_PREFIX
)
objcopy
...
...
This diff is collapsed.
Click to expand it.
include/eeprom.h
+
35
−
30
View file @
4bea0ec1
...
...
@@ -2,21 +2,37 @@
******************************************************************************
* @file EEPROM_Emulation/inc/eeprom.h
* @author MCD Application Team
* @version V1.0.0
* @date 1
0-Octo
ber-201
1
* @version V1.0.0
* @date 1
7-Decem
ber-201
4
* @brief This file contains all the functions prototypes for the EEPROM
* emulation firmware library.
******************************************************************************
* @attention
*
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
* <h2><center>© COPYRIGHT(c) 2014 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.
*
* <h2><center>© COPYRIGHT 2011 STMicroelectronics</center></h2>
******************************************************************************
*/
...
...
@@ -24,34 +40,24 @@
#ifndef __EEPROM_H
#define __EEPROM_H
#ifdef __cplusplus
extern
"C"
{
#endif
/* Includes ------------------------------------------------------------------*/
#include
"stm32f4xx.h"
#include
"stm32f4xx
_hal
.h"
/* Exported constants --------------------------------------------------------*/
/* Define the size of the sectors to be used */
#define PAGE_SIZE (uint32_t)0x4000
/* Page size = 16KByte */
/* Device voltage range supposed to be [2.7V to 3.6V], the operation will
be done by word */
#define VOLTAGE_RANGE (uint8_t)VoltageRange_3
#define PAGE_SIZE (uint32_t)0x4000
/* Page size */
/* EEPROM start address in Flash */
#define EEPROM_START_ADDRESS ((uint32_t)0x08004000)
/* EEPROM emulation start address:
from sector2 : after 16KByte of used
Flash memory */
#define EEPROM_START_ADDRESS ((uint32_t)0x08004000)
/* EEPROM emulation start address */
/* Pages 0 and 1 base and end addresses */
#define PAGE0_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + 0x0000))
#define PAGE0_END_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + (PAGE_SIZE - 1)))
#define PAGE0_ID
FLASH_S
ector
_1
#define PAGE0_ID FLASH_S
ECTOR
_1
#define PAGE1_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + 0x4000))
#define PAGE1_END_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS +
(2 *
PAGE_SIZE - 1))
)
#define PAGE1_ID
FLASH_S
ector
_2
#define PAGE1_END_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS +
2*
PAGE_SIZE - 1))
#define PAGE1_ID FLASH_S
ECTOR
_2
/* Used Flash pages for EEPROM emulation */
#define PAGE0 ((uint16_t)0x0000)
...
...
@@ -83,6 +89,9 @@ extern "C" {
#define LAST_EEPROM_OFFSET ((uint16_t)0x0017)
/* Variables' number */
#define NB_OF_VAR ((uint8_t)0x03)
/* Exported types ------------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
...
...
@@ -90,10 +99,6 @@ uint16_t EE_Init(void);
uint16_t
EE_ReadVariable
(
uint16_t
VirtAddress
,
uint16_t
*
Data
);
uint16_t
EE_WriteVariable
(
uint16_t
VirtAddress
,
uint16_t
Data
);
#ifdef __cplusplus
}
#endif
#endif
/* __EEPROM_H */
/******************* (C) COPYRIGHT
2011
STMicroelectronics *****END OF FILE****/
/*******************
*****
(C) COPYRIGHT STMicroelectronics *****END OF FILE****/
This diff is collapsed.
Click to expand it.
linker_script/
STM32F4_1024FLASH_192RAM
.ld
→
linker_script/
bioloid
.ld
+
0
−
0
View file @
4bea0ec1
File moved
This diff is collapsed.
Click to expand it.
src/bioloid_stm32.c
+
3
−
0
View file @
4bea0ec1
#include
"stm32f4xx_hal.h"
#include
"bioloid_dyn_slave.h"
#include
"gpio.h"
#include
"eeprom.h"
#include
"bioloid_time.h"
#include
"stm32_time.h"
...
...
@@ -9,6 +10,8 @@ int32_t main(void)
HAL_Init
();
/* initialize the gpio */
gpio_init
();
/* initialize the eeprom emmulation */
// EE_Init();
/* initialize the time module */
bioloid_time_init
();
/* initialize the dynamixel slave interface */
...
...
This diff is collapsed.
Click to expand it.
src/eeprom.c
+
311
−
195
View file @
4bea0ec1
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment