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
arm-linux-gnueabihf-gcc -c -O2 -ggdb -Wall -fno-stack-protector -o example2.o example2.c | |
arm-linux-gnueabihf-as -o multiply.o multiply.s | |
multiply.s: Assembler messages: | |
multiply.s:12: Rd and Rm should be different in mla | |
arm-linux-gnueabihf-gcc -o example2 example2.o multiply.o | |
qemu-arm -L /usr/arm-linux-gnueabihf ./example2 | |
a * b is 140 | |
a * b + c is 143 | |
c - a * b is -137 |
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
# Some pre-defined variables of make | |
# | |
# $? - updated dependencies | |
# $@ - target value | |
# $< - first dependencie | |
# $^ - all dependencies, seperated with space | |
# $* - target name without extension | |
# | |
CC = arm-linux-gnueabihf-gcc | |
AS = arm-linux-gnueabihf-as |
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
.syntax unified | |
.arch armv7-a | |
.text | |
.align 2 | |
.thumb | |
.thumb_func | |
.global fibonacci | |
.type fibonacci, function |
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
.syntax unified | |
.arch armv7-a | |
.text | |
.align 2 | |
.thumb | |
.thumb_func | |
.global fibonacci | |
.type fibonacci, function |
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
#define MKCL(n, d) {.name=#n, .fptr=n ## _command, .desc=d} | |
cmdlist cl[]={ | |
MKCL(ls, "List directory"), | |
MKCL(man, "Show the manual of the command"), | |
MKCL(cat, "Concatenate files and print on the stdout"), |
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
mkdir -p workspace | |
cd workspace | |
git clone git://github.com/beckus/stm32_p103_demos.git || git clone https://github.com/beckus/stm32_p103_demos.git | |
git clone git://github.com/beckus/qemu_stm32.git || git clone https://github.com/beckus/qemu_stm32.git | |
cd qemu_stm32 | |
git submodule update --init dtc || sudo apt-get install libfdt-dev | |
./configure --disable-werror --enable-debug \ | |
--target-list="arm-softmmu" \ | |
--extra-cflags=-DSTM32_UART_NO_BAUD_DELAY \ |
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
cd ~/workspace | |
git clone git@github.com:embedded2015/freertos-basic.git | |
# 或者: git clone https://github.com/embedded2015/freertos-basic.git | |
cd freertos-basic | |
make | |
make qemu | |
輸入 “help” 可見已實作的 shell command | |
ps | |
mmtest |
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
#include<stdio.h> | |
struct ABC { | |
int index; | |
char name[6]; | |
int score; | |
} __attribute__((packed));; | |
struct DEF { | |
int att; | |
char name[3]; |
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
void fibo_command(int n, char *argv[]) { | |
int i = 0; | |
int first = 0; | |
int second = 1; | |
int result; | |
fio_printf(1, "\r\n"); | |
if(n == 1) { | |
fio_printf(1, "Please assign a number \r\n"); |
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
void vTaskStartScheduler( void ) | |
{ | |
portBASE_TYPE xReturn; | |
/* Add the idle task at the lowest priority. */ | |
#if ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) | |
{ | |
/* Create the idle task, storing its handle in xIdleTaskHandle so it can | |
be returned by the xTaskGetIdleTaskHandle() function. */ | |
xReturn = xTaskCreate( prvIdleTask, ( signed char * ) "IDLE", tskIDLE_STACK_SIZE, ( void * ) NULL, ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), &xIdleTaskHandle ); |
OlderNewer