練習 ARM Cortex-M4 處理器所做的練習項目,專案可見 cm4bmp
Inline Assembly Coding
Example 1: Load 2 values from memory, add them and store it to memory by using inline assembly statement
地址0x20001000初始值: 6
地址0x20001004初始值: 4
將地址 0x20001000 及 0x20001004 分別放入 R1 及 R2
/* move 0x20001000 to R1 */
__asm volatile("LDR R1,=#0x20001000");
Risheng changed 2 years agoView mode Like 1 Bookmark
contributed by < Risheng1128 >
Linux2022 開發紀錄(lab0)
Linux2023 開發紀錄(lab0)
首先 Linux kernel 的 merge sort 主要由三個函式 list_sort() 、 merge() 及 merge_final() 組成,以下開始分析每個函式所做的功能
在分析函式之前,先了解函式的 prototype ,每個函式的宣告都擁有函式屬性 __attribute__((nonnull())) ,參考 __attribute__((nonnull)) function attribute 可以得知 nonnull 是用來使特定函數的引數為 NULL 時,編譯器會發出警告
This function attribute specifies function parameters that are not supposed to be null pointers. This enables the compiler to generate a warning on encountering such a parameter.
Risheng changed 2 years agoView mode Like 3 Bookmark
:::info
目標
學習 ARM TrustZone ,理解其設計及架構,並且進一步學習 ARM Trusted Firmware-M
:::
ARM TrustZone for ARMv8-M
學習 ARM TF-M 之前,應該先學習其基礎架構 TrustZone
在學習 ARM TrustZone 的路上讀了很多第二手文件,繞了非常多冤枉路,但最後發現還是第一手文件 TrustZone technology for Armv8-M Architecture Version 2.1 最清楚,又再次證明第一手文件的重要性
Risheng changed 2 years agoView mode Like 2 Bookmark
Rewrite Length of Last Word
I choose the Length of Last Word from 蕭珮珊
Motivation: I think the problem is interesting, and I want to practice how to send the u32 data to emulator
#include <string.h>
void Display(const char* str){
/* Send char to UART Tx */
volatile char* u8tx = (volatile char*)0x40002000;
while(*str)
Risheng changed 2 years agoView mode Like Bookmark
Assignment1: RISC-V Assembly and Instruction Pipeline
Lab1: RV32I Simulator
Introduction
I choose the problem Leetcode912.
Example:
Input: nums = [5,2,3,1]
wanghanchi changed 3 years agoView mode Like Bookmark