Skip to content

Instantly share code, notes, and snippets.

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
# 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
.syntax unified
.arch armv7-a
.text
.align 2
.thumb
.thumb_func
.global fibonacci
.type fibonacci, function
.syntax unified
.arch armv7-a
.text
.align 2
.thumb
.thumb_func
.global fibonacci
.type fibonacci, function
#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"),
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 \
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
#include<stdio.h>
struct ABC {
int index;
char name[6];
int score;
} __attribute__((packed));;
struct DEF {
int att;
char name[3];
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");
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 );