Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
templates: (stm32f7) Add new template for USB Cube's examples
- Loading branch information
1 parent
8b93f16
commit e9f2283
Showing
5 changed files
with
172 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
TARGET = embox | ||
|
||
PLATFORM = | ||
|
||
ARCH = arm | ||
|
||
CROSS_COMPILE = arm-none-eabi- | ||
|
||
CFLAGS += -O0 -g | ||
|
||
// We do not pass -march=armv7e-m because it does not working together with -mcpu=cortex-m7 | ||
// See https://bugs.launchpad.net/gcc-arm-embedded/+bug/1592635 | ||
// Moreover, as it stated in the bug, "We advise against the use of both -mcpu and -march switches" | ||
CFLAGS += -mthumb -mlittle-endian -mcpu=cortex-m7 -msoft-float -ffreestanding | ||
|
||
LDFLAGS += -N -g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Linkage configuration. | ||
*/ | ||
|
||
/* region (origin, length) */ | ||
ROM (0x08000000, 1M) | ||
RAM (0x20000000, 256K) | ||
region(SRAM_CCM, 0x10000000, 64K) | ||
|
||
/* section (region[, lma_region]) */ | ||
text (ROM) | ||
rodata (ROM) | ||
data (RAM, ROM) | ||
bss (RAM) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
|
||
package genconfig | ||
|
||
configuration conf { | ||
@Runlevel(0) include embox.arch.system(core_freq=216000000) | ||
@Runlevel(0) include embox.arch.arm.cortexm3.bundle | ||
@Runlevel(0) include third_party.bsp.stmf7cube.arch | ||
include embox.arch.arm.vfork | ||
|
||
@Runlevel(0) include embox.kernel.stack(stack_size=0x8000,alignment=4) | ||
|
||
@Runlevel(1) include embox.driver.interrupt.cortexm_nvic(irq_table_size=128) | ||
/*@Runlevel(1) include embox.driver.interrupt.cmsis_nvic*/ | ||
@Runlevel(1) include embox.driver.clock.cortexm_systick | ||
@Runlevel(1) include embox.driver.serial.stm_usart_f7(baud_rate=115200, usartx=1) | ||
@Runlevel(1) include embox.driver.diag(impl="embox__driver__serial__stm_usart_f7") | ||
//@Runlevel(1) include embox.driver.serial.stm_ttyS1(baud_rate=115200, usartx=6) | ||
@Runlevel(1) include embox.driver.serial.stm_ttyS0(baud_rate=115200, usartx=1) | ||
|
||
@Runlevel(2) include embox.driver.net.stm32f7cube_eth | ||
@Runlevel(2) include embox.driver.net.loopback | ||
//@Runlevel(2) include embox.driver.flash.stm32f4cube | ||
|
||
include embox.kernel.task.multi | ||
include embox.kernel.task.resource.idesc_table(idesc_table_size=32) | ||
|
||
include embox.kernel.thread.thread_local_none | ||
include embox.kernel.thread.thread_cancel_disable | ||
include embox.kernel.thread.signal_stub | ||
include embox.kernel.timer.sleep_nosched | ||
include embox.net.skbuff(amount_skb=10) | ||
include embox.net.skbuff_data(amount_skb_data=10) | ||
include embox.net.sock_noxattr | ||
include embox.net.tcp | ||
include embox.net.tcp_sock | ||
include embox.kernel.sched.sched | ||
include embox.kernel.sched.idle_light | ||
//include embox.kernel.thread.signal_stub | ||
|
||
include embox.kernel.lthread.lthread | ||
include embox.kernel.thread.core(thread_pool_size=2, thread_stack_size=0x8000) | ||
|
||
/* tty requires */ | ||
include embox.kernel.thread.mutex | ||
include embox.driver.tty.tty(rx_buff_sz=16, io_buff_sz=16) | ||
include embox.driver.tty.task_breaking_disable | ||
|
||
@Runlevel(2) include embox.cmd.msleep | ||
@Runlevel(2) include embox.cmd.sh.tish(builtin_commands = "cd export exit logout httpd") | ||
include embox.init.setup_tty_diag | ||
@Runlevel(3) include embox.init.start_script(shell_name="tish") | ||
|
||
include embox.cmd.service | ||
include embox.cmd.fs.ls | ||
include embox.cmd.net.ifconfig | ||
include embox.cmd.net.route | ||
include embox.cmd.net.ping | ||
include embox.cmd.net.telnetd | ||
include embox.cmd.net.httpd(use_real_cmd=true) | ||
include embox.cmd.net.httpd_cgi | ||
include embox.service.http_admin | ||
include embox.demo.website | ||
|
||
include embox.compat.posix.proc.vfork_exchanged | ||
include embox.compat.posix.proc.exec_exchanged | ||
|
||
include embox.util.hashtable | ||
include embox.cmd.help | ||
include embox.cmd.sys.version | ||
include embox.util.log | ||
include embox.kernel.critical | ||
include embox.kernel.irq | ||
include embox.mem.pool_adapter | ||
|
||
include embox.util.LibUtil | ||
/*include embox.framework.embuild_light*/ | ||
include embox.framework.LibFramework | ||
include embox.arch.arm.libarch | ||
include embox.compat.libc.stdio.print(support_floating=0) | ||
|
||
include embox.mem.heap_bm | ||
include embox.mem.static_heap(heap_size=0x8000) | ||
include embox.mem.bitmask(page_size=64) | ||
|
||
include third_party.bsp.stmf7cube.core | ||
include third_party.bsp.stmf7cube.cmsis | ||
|
||
include embox.fs.driver.initfs_dvfs | ||
include embox.fs.driver.devfs_dvfs | ||
include embox.fs.rootfs_dvfs(fstype="initfs") | ||
|
||
include embox.driver.char_dev_dvfs | ||
include embox.driver.serial.uart_dev_dvfs | ||
|
||
include embox.fs.dvfs.core(inode_pool_size=6, dentry_pool_size=6, inode_pool_size=6) | ||
include embox.compat.posix.fs.all_dvfs | ||
include embox.fs.syslib.perm_stub | ||
include embox.driver.block_common | ||
include embox.driver.block_dvfs | ||
|
||
include third_party.bsp.stmf7cube.middlewares_usb_device | ||
include third_party.bsp.stmf7cube.middlewares_usb_host | ||
include third_party.bsp.stmf7cube.middlewares_fat_fs | ||
/* Include one of the following examples */ | ||
//include stm32f7.cmd.usb_device_example | ||
//include stm32f7.cmd.usb_host_example | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
**** This config demonstarates USB device and host examples imported from STM32 Cube. | ||
|
||
Compile and run one of the two following examples: | ||
|
||
1. USB DEVICE example (include stm32f7.cmd.usb_device_example) | ||
|
||
1. Build Embox. | ||
|
||
2. # ./scripts/stm32/import_stm32_cube_example.py --name usb_device_example --platform f7 ./build/extbld/third_party/bsp/stmf7cube/core/STM32Cube_FW_F7_V1.5.0/Projects/STM32746G-Discovery/Applications/USB_Device/MSC_Standalone | ||
|
||
After Execution of this command, the folder 'platform/stm32f7/cmds/usb_device_example' will be created with corresponding sources imported from Cube. | ||
Read usb_device_example/readme.txt to figure out what this example should do. | ||
|
||
3. Now you should to enable USE_USB_HS or USE_USB_FS as it is stated in usb_device_example/readme.txt. To do this, modify platform/stm32f7/cmds/usb_device_example/Src/usbd_conf.c: Insert '#define USE_USB_HS' at the beginning of the file. | ||
|
||
4. Uncomment module 'stm32f7.cmd.usb_device_example' in mods.config and rebuild Embox. | ||
|
||
Type 'usb_device_example' in Embox shell to launch the imported example. | ||
|
||
2. USB HOST example (include stm32f7.cmd.usb_host_example) | ||
|
||
1. Build Embox. | ||
|
||
2. # ./scripts/stm32/import_stm32_cube_example.py --name usb_host_example --platform f7 ./build/extbld/third_party/bsp/stmf7cube/core/STM32Cube_FW_F7_V1.5.0/Projects/STM32746G-Discovery/Applications/USB_Host/MSC_Standalone | ||
|
||
After Execution of this command, the folder 'platform/stm32f7/cmds/usb_host_example' will be created with corresponding sources imported from Cube. | ||
Read usb_host_example/readme.txt to figure out what this example should do. | ||
|
||
3. Now you should to enable USE_USB_HS or USE_USB_FS as it is stated in usb_host_example/readme.txt. To do this, modify platform/stm32f7/cmds/usb_host_example/Src/usbh_conf.c: Insert '#define USE_USB_HS' at the beginning of the file. | ||
|
||
4. Uncomment module 'stm32f7.cmd.usb_host_example' in mods.config and rebuild Embox. | ||
|
||
Type 'usb_host_example' in Embox shell to launch the imported example. |
Empty file.