Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
#include <stdint.h>
#include <modules/platform_stm32f302x8/platform_stm32f302x8.h>

#define BOARD_CONFIG_HW_NAME "org.proficnc.uwb"
#define BOARD_CONFIG_HW_MAJOR_VER 1
#define BOARD_CONFIG_HW_MINOR_VER 0

#define BOARD_CONFIG_HW_INFO_STRUCTURE { \
.hw_name = BOARD_CONFIG_HW_NAME, \
.hw_major_version = BOARD_CONFIG_HW_MAJOR_VER, \
.hw_minor_version = BOARD_CONFIG_HW_MINOR_VER, \
.board_desc_fmt = SHARED_HW_INFO_BOARD_DESC_FMT_NONE, \
.board_desc = 0, \
}

#define BOARD_PAL_LINE_SPI_SCK PAL_LINE(GPIOB,3)
#define BOARD_PAL_LINE_SPI_MISO PAL_LINE(GPIOB,4)
#define BOARD_PAL_LINE_SPI_MOSI PAL_LINE(GPIOB,5)
Expand Down
13 changes: 13 additions & 0 deletions examples/driver_invensense/boards/com.hex.flow_1.0/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

#include <modules/platform_stm32f302x8/platform_stm32f302x8.h>


#define BOARD_CONFIG_HW_NAME "org.proficnc.flow"
#define BOARD_CONFIG_HW_MAJOR_VER 1
#define BOARD_CONFIG_HW_MINOR_VER 0

#define BOARD_CONFIG_HW_INFO_STRUCTURE { \
.hw_name = BOARD_CONFIG_HW_NAME, \
.hw_major_version = BOARD_CONFIG_HW_MAJOR_VER, \
.hw_minor_version = BOARD_CONFIG_HW_MINOR_VER, \
.board_desc_fmt = SHARED_HW_INFO_BOARD_DESC_FMT_NONE, \
.board_desc = 0, \
}

#define BOARD_PAL_LINE_SPI3_SCK PAL_LINE(GPIOB,3)
#define BOARD_PAL_LINE_SPI3_MISO PAL_LINE(GPIOB,4)
#define BOARD_PAL_LINE_SPI3_MOSI PAL_LINE(GPIOB,5)
Expand Down
16 changes: 14 additions & 2 deletions modules/flash/flash_stm32f3.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,26 @@
#include <ch.h>
#include <hal.h>
#ifdef STM32F3xx_MCUCONF
#define STM32_FLASH_BASE 0x08000000


#define FLASH_WORD_SIZE sizeof(flash_word_t)
typedef uint16_t flash_word_t;

uint32_t flash_getpageaddr(uint32_t page)
void* flash_get_page_addr(uint32_t page)
{
return (page*2048);
return (void*)(STM32_FLASH_BASE + (page*2048));
}

int16_t flash_get_page_num(void *address)
{
uint32_t _addr = (uint32_t)address;
return (_addr-STM32_FLASH_BASE)/2048;
}

uint32_t flash_get_page_ofs(uint32_t page)
{
return page*2048;
}

static void __attribute__((noinline)) flash_wait_until_ready(void) {
Expand Down
4 changes: 2 additions & 2 deletions platforms/ARMCMx/ld/stm32f302x8/memory.ld
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MEMORY
{
bl (rx) : ORIGIN = 0x08000000, LENGTH = 12K
app (rx) : ORIGIN = 0x08000000+12K, LENGTH = 64K-12K-4K
bl (rx) : ORIGIN = 0x08000000, LENGTH = 18K
app (rx) : ORIGIN = 0x08000000+18K, LENGTH = 64K-18K-4K
param1 (rx) : ORIGIN = 0x08000000+60K, LENGTH = 2K
param2 (rx) : ORIGIN = 0x08000000+62K, LENGTH = 2K
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 16K-256
Expand Down