Skip to content
Snippets Groups Projects
Commit 077a0aba authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Added the motion pages modules.

Modified the linker script to account for the motion pages section (128k)
parent d6fe6fc4
No related branches found
No related tags found
No related merge requests found
#ifndef _MOTION_PAGES_H
#define _MOTION_PAGES_H
#include "stm32f4xx.h"
#define MAX_PAGES 128
#define PAGE_MAX_NUM_SERVOS 31
#define POSE_NUMBER_OF_POSES_PER_PAGE 7
typedef struct // Header Structure (total 64unsigned char)
{
uint8_t name[13]; // Name 0~13
uint8_t reserved1; // Reserved1 14
uint8_t repeat; // Repeat count 15
uint8_t schedule; // schedule 16
uint8_t reserved2[3]; // reserved2 17~19
uint8_t stepnum; // Number of step 20
uint8_t reserved3; // reserved3 21
uint8_t speed; // Speed 22
uint8_t reserved4; // reserved4 23
uint8_t accel; // Acceleration time 24
uint8_t next; // Link to next 25
uint8_t exit; // Link to exit 26
uint8_t reserved5[4]; // reserved5 27~30
uint8_t checksum; // checksum 31
uint8_t slope[PAGE_MAX_NUM_SERVOS]; // CW/CCW compliance slope 32~62
uint8_t reserved6; // reserved6 63
} TPageHeader;
typedef struct // Step Structure (total 64unsigned char)
{
uint16_t position[PAGE_MAX_NUM_SERVOS]; // Joint position 0~61
uint8_t pause; // Pause time 62
uint8_t time; // Time 63
} TStep;
typedef struct // Page Structure (total 512unsigned char)
{
TPageHeader header; // Page header 0~64
TStep steps[POSE_NUMBER_OF_POSES_PER_PAGE]; // Page step 65~511
} TPage;
extern TPage motion_pages[MAX_PAGES];
#endif
...@@ -42,7 +42,8 @@ MEMORY ...@@ -42,7 +42,8 @@ MEMORY
{ {
FLASH1 (rx) : ORIGIN = 0x08000000, LENGTH = 16K FLASH1 (rx) : ORIGIN = 0x08000000, LENGTH = 16K
EEPROM (rw) : ORIGIN = 0x08004000, LENGTH = 32K EEPROM (rw) : ORIGIN = 0x08004000, LENGTH = 32K
FLASH2 (rx) : ORIGIN = 0x0800C000, LENGTH = 976K FLASH2 (rx) : ORIGIN = 0x0800C000, LENGTH = 848K
PAGES (rx) : ORIGIN = 0x080E0000, LENGTH = 128K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
} }
...@@ -153,6 +154,12 @@ SECTIONS ...@@ -153,6 +154,12 @@ SECTIONS
_eccmram = .; /* create a global symbol at ccmram end */ _eccmram = .; /* create a global symbol at ccmram end */
} >CCMRAM AT> FLASH2 } >CCMRAM AT> FLASH2
.pages :
{
. = ALIGN(4);
*(.pages)
. = ALIGN(4);
} >PAGES
/* Uninitialized data section */ /* Uninitialized data section */
. = ALIGN(4); . = ALIGN(4);
......
#include "motion_pages.h"
TPage motion_pages[MAX_PAGES] __attribute__ ((section (".pages")));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment