Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples stuff: fix examples/rules, extend rules and add f7 examples #193

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
PREFIX ?= arm-none-eabi
#PREFIX ?= arm-elf

TARGETS := stm32/f0 stm32/f1 stm32/f2 stm32/f3 stm32/f4 stm32/l0 stm32/l1
TARGETS += lpc/lpc13xx lpc/lpc17xx #lpc/lpc43xx
TARGETS := stm32/f0 stm32/f1 stm32/f2 stm32/f3 stm32/f4
TARGETS += stm32/l0 stm32/l1 stm32/l4
TARGETS += lpc/lpc13xx lpc/lpc17xx lpc/lpc43xx
TARGETS += tiva/lm3s tiva/lm4f
TARGETS += efm32/efm32tg efm32/efm32g efm32/efm32lg efm32/efm32gg
TARGETS += vf6xx
Expand Down
2 changes: 1 addition & 1 deletion examples/lpc/lpc43xx/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


LIBNAME = opencm3_lpc43xx
DEFS += -DLPC43XX
DEFS += -DLPC43XX -DLPC43XX_M4

FP_FLAGS ?= -mfloat-abi=hard -mfpu=fpv4-sp-d16
ARCH_FLAGS = -mthumb -mcpu=cortex-m4 $(FP_FLAGS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ MEMORY
{
/* rom is really the shadow region that points to SPI flash or elsewhere */
rom (rx) : ORIGIN = 0x00000000, LENGTH = 1M
ram (rwx) : ORIGIN = 0x10000000, LENGTH = 128K
ram_local1 (rwx) : ORIGIN = 0x10000000, LENGTH = 128K
/* there are some additional RAM regions */
ram_local2 (rw) : ORIGIN = 0x10080000, LENGTH = 72K
}

/* Include the common ld script. */
INCLUDE libopencm3_lpc43xx.ld
INCLUDE lpc43xx/m4/libopencm3_lpc43xx.ld
2 changes: 1 addition & 1 deletion examples/lpc/lpc43xx/hackrf-jellybean/i2c/i2cdemo.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ int main(void)
int i;

gpio_setup();
i2c0_init();
i2c0_init(15);

gpio_set(PORT_EN1V8, PIN_EN1V8); /* 1V8 on */

Expand Down
5 changes: 3 additions & 2 deletions examples/lpc/lpc43xx/hackrf-jellybean/jellybean-lpc4330.ld
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ MEMORY
{
/* rom is really the shadow region that points to SPI flash or elsewhere */
rom (rx) : ORIGIN = 0x00000000, LENGTH = 1M
ram (rwx) : ORIGIN = 0x10000000, LENGTH = 128K
ram_local1 (rwx) : ORIGIN = 0x10000000, LENGTH = 128K
/* there are some additional RAM regions */
ram_local2 (rw) : ORIGIN = 0x10080000, LENGTH = 72K
}

/* Include the common ld script. */
INCLUDE libopencm3_lpc43xx.ld
INCLUDE lpc43xx/m4/libopencm3_lpc43xx.ld
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ MEMORY
rom_flash (rx) : ORIGIN = 0x80000000, LENGTH = 1M
/* rom is really the shadow region that points to SPI flash or elsewhere */
rom (rx) : ORIGIN = 0x00000000, LENGTH = 1M
ram (rwx) : ORIGIN = 0x10000000, LENGTH = 128K
ram_local1 (rwx) : ORIGIN = 0x10000000, LENGTH = 128K
/* there are some additional RAM regions for data */
ram_data (rw) : ORIGIN = 0x10080000, LENGTH = 72K
ram_local2 (rw) : ORIGIN = 0x10080000, LENGTH = 72K
}

/* Include the common ld script. */
INCLUDE libopencm3_lpc43xx_rom_to_ram.ld
INCLUDE lpc43xx/m4/libopencm3_lpc43xx_rom_to_ram.ld
2 changes: 1 addition & 1 deletion examples/lpc/lpc43xx/hackrf-jellybean/ssp/sspdemo.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ int main(void)

while (1) {

ssp_write(SSP1_NUM, (uint16_t)ssp_val);
ssp_transfer(SSP1_NUM, (uint16_t)ssp_val);

gpio_set(GPIO2, GPIOPIN1); /* LED on */

Expand Down
6 changes: 3 additions & 3 deletions examples/lpc/lpc43xx/hackrf-jellybean/systick/systickdemo.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ static void systick_setup(void)
g_ulSysTickCount = 0;

/* Disable IRQ globally */
asm volatile ("cpsid i");
__asm__ __volatile__ ("cpsid i");

/* Set processor Clock as Source Clock */
systick_set_clocksource(STK_CTRL_CLKSOURCE);
systick_set_clocksource(STK_CSR_CLKSOURCE);

/* Get SysTick calibration value to obtain by default 1 tick = 10ms */
systick_reload_val = systick_get_calib();
Expand All @@ -97,7 +97,7 @@ static void systick_setup(void)
nvic_set_priority(NVIC_SYSTICK_IRQ, 0xFF);

/* Enable IRQ globally */
asm volatile ("cpsie i");
__asm__ __volatile__ ("cpsie i");
}

static void scs_dwt_cycle_counter_enabled(void)
Expand Down
44 changes: 44 additions & 0 deletions examples/stm32/l4/Makefile.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
##
## This file is part of the libopencm3 project.
##
## This library 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.
##
## This library 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.
##
## You should have received a copy of the GNU Lesser General Public License
## along with this library. If not, see <http://www.gnu.org/licenses/>.
##

# You should use linker script generation! Specify device!
ifeq ($(DEVICE),)
LIBNAME = opencm3_stm32l4
DEFS += -DSTM32L4

FP_FLAGS ?= -mfloat-abi=hard -mfpu=fpv5-sp-d16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where di you get that it's v5?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right though, I have this as an unchecked in file locally, never committed when the "basics" example was added.

ARCH_FLAGS = -mthumb -mcpu=cortex-m4 $(FP_FLAGS)
endif

################################################################################
# OpenOCD specific variables

OOCD ?= openocd
OOCD_INTERFACE ?= stlink-v2-1
OOCD_TARGET ?= stm32l4x

################################################################################
# Black Magic Probe specific variables
# Set the BMP_PORT to a serial port and then BMP is used for flashing
BMP_PORT ?=

################################################################################
# texane/stlink specific variables
#STLINK_PORT ?= :4242


include ../../../../rules.mk