stm8使用atomthreads專案

2021-07-13 19:03:42 字數 1665 閱讀 1619

error[lc036]: no block or place matches the pattern "ro code section .text in atomport-asm-iar.o" 

---section .text:code

+++section .near_func.text:code

編譯成功

但發現iar編譯成功後居然不在軟體中顯示ram、rom的使用量

檢視ports/stm8/debug目錄下面的log和map檔案才能看到,map裡面對每個c檔案占用的ram和rom都有說明。。。。。

燒錄到stm8中,串列埠和gpiod0均會有輸出並會輸出semaphore的測試資訊,沒有錯誤資訊標示atomthreads正常執行起來了!

一、新增中斷(有兩處需要修改)

1、在ports/stm8/stm8_interrupt_vector.c中

struct interrupt_vector const _vectab = , /* reset */

, /* trap  */

, /* irq0  */

, /* irq1  */

, /* irq2  */

, /* irq3  */

, /* irq4  */

, /* irq5  */

, /* irq6  */

, /* irq7  */

, /* irq8  */

, /* irq9  */

, /* irq10 */

, /* irq11 */

, /* irq12 */

, /* irq13 */

, /* irq14 */

, /* irq15 */

, /* irq16 */

, /* irq17 */

, /* irq18 */

, /* irq19 */

, /* irq20 */

, /* irq21 */

, /* irq22 */

, /* irq23 */

, /* irq24 */

, /* irq25 */

, /* irq26 */

, /* irq27 */

, /* irq28 */

, /* irq29 */

};2、

#if defined(__iar_systems_icc__)

#pragma vector = 3//datasheet中的中斷號+2

#endif

interrupt void awu_irqhandler (void)

#if defined(__rcstm8__)

interrupt 1//datasheet中的中斷號

#endif

二、驅動修改

atomthreads中的驅動很少,只有clk、gpio、itc、tim1和uart2的驅動,實在無法完成工作。我就將需要的驅動從stm8韌體庫拷貝過來加入工程,需要修改一下頭檔案,不過很簡單這裡就不細說了

三、總結

最後我使用了兩個執行緒,乙個執行fft,乙個現實數碼管,fft速度慢的可以20多毫秒才能完成一次32點的計算,其中還把sin、cos採用查表方法處理了。。。。

stm8之OptionByte的使用

1 stm 8s的配 置位元組o ptio nbyt e 2 stm8s option byte操作方式 1.選項位元組的概念 參考stm8s中文資料手冊 選項位元組包括晶元硬體特性的配置和儲存器的保護資訊,這些位元組儲存在儲存器中乙個專用的 塊內。除了rop 讀出保護 位元組,每個選項位元組必須被...

STM8 開發備忘

前段時間寫了一點stm8的 現在總結一下。iar 指的是iar embedded workbench。又稱為ewstm8。我是用的是ewstm8 2105 autorun.exe。破解後會報乙個庫載入失敗。沒有關係可以繼續用。1.檢視晶元型號 專案右鍵 選項 目標,我的是stm8l151g6。可以根...

STM8擦除方法

使用stvp燒錄stm8,擦除選項一直為灰 擦除方法 第一步 在option byte裡面,把rop選項設為read out protection on,然後燒錄 依次選擇program,current tab 第二步 繼續在option byte裡面,把rop選項設為read out protec...