bloggerads

2021年7月24日 星期六

Scatter File Note

用來描述source code裡面, 變數, 程式要放到memory的哪一段位址.
然後一些defin, source code 和 scatter file會互相參考

常見的簡單 scatter file內容:

1.

https://developer.arm.com/documentation/dui0493/i/Chdbjdii


execution region的起始位置設為load region的起始位置

 2.

LOAD ADDR SIZE ;ADDR: 起始位址, SIZE: 長度
{
    RO +0
    {
        * (+RO)
    }

    RW +0 ;跟在前一個區域後面接著放
    {
        * (+RW)
    }

    ZI +0
    {
        * (+ZI)
    }
}

2021年7月19日 星期一

Windows平台用cygwin安裝build code工具make

1. Download cygwin
https://www.cygwin.com/
2. Execute the exe:
When you get to the "Select Packages" screen, expand the "Devel" section, find the "make" package, and select the version you want
3. Add make path to the environment. (typically under cygwin64/bin)
4. Done.

2021年7月14日 星期三

2021年7月6日 星期二

ARM 打包 library的command

打包成.a的形式:   armar   -r  mylib.a   obj1   obj2   obj3

打包成.lib的形式: armar   --create   mylib.lib   obj1   obj2 

.a或.lib可以直接和其他.o檔一起link, 產生出最後的binary

Visual Studio Hotkey/Operation (Continue Update..)

Duplicate this line: Alt + Shift + ↓

Comment/Uncomment line(s): Ctrl + /

Search Function: Ctrl + t

Bookmark: Ctrl + Alt + k

Jump to Bookmark: Ctrl + Alt + j

Trim trailing space automatically:

Transform TAB to Space

Show the function list in a file



2021年6月29日 星期二

Add a Git Submodule

Use Git Turtoise:

TortoiseGit -> Submodule Add...

Use Git Command:

git submodule add -b <branch> --name <submodule name> <repository> <folder path>

----------------------------------------------------------------------------------------------

After setting the previous step, you will find the new file ".gitmodules" is created (or updated)
Check the contents if it is as expect:

[submodule "name"]

path <folder path>

url =  <repository>

branch <branch>  -->  One of branch in the Submodule repository (Can ignore this one)

----------------------------------------------------------------------------------------------

Following Issue happened in build code after I add the submodule in my one of project:

cp: cannot overwrite directory 'xxxxxxxx.git' with non-directory

This means the build procedure is trying to copy xxxxxxxx.git to somewhere the xxxxxxxx.git has already existed.

I did the following steps to overcome this problem. (or you can simply delete it, and it will be automatically generated during submodule init)

1. git commit/check-in the code 
2. delete the xxxxxxxx.git in the submodule 
3. git submodule init/update



2021年6月26日 星期六

Arm Memory Structure Note

Observe the .lst file (generated by ARM compiler) to get the following conclustion.
ARM memory map is consists of:
  1. .Code
  2. .RO
  3. .RW
  4. .ZI
.Code = Code + inline Data
.RO = Constant Data
.RW = Local Variable
.ZI = Global Variable (Include Static Variable)

Add any code that may possibly increase RAM or ROM size.

ROM size = .Code + .RO + .RW 
RAM size = .RW + .ZI

The actual ARM outputted binary size is ROM size

<NOTE>
What makes .RW so special is because .RW data stays in the ROM but during initializing, it will be copied to RAM