RTOS为什么编译出来的SPI_MAP显示不对呢?

tobewinner
Posts: 45
Joined: Tue Jan 19, 2016 2:39 pm

RTOS为什么编译出来的SPI_MAP显示不对呢?

Postby tobewinner » Thu Jul 21, 2016 3:26 pm

我使用的RTOS版本是:

Code: Select all

OS SDK ver: 1.4.0(c599790) compiled @ Feb 26 2016 11:08:14

编译时 SPI_MAP选择是2,编译的输出是:

Code: Select all

Support boot_v1.2 and +
Generate user1.1024.new.2.bin successully in BIN_PATH
boot.bin------------>0x00000
user1.1024.new.2.bin--->0x01000
!!!

所用的FLASH大小为8Mbits

Code: Select all

flash vendor:
EFh : WB
flash devID:
4014h
QUAD;8Mbit
crystal:
40 Mhz

可是启动时显示时:

Code: Select all

2nd boot version : 1.5
  SPI Speed      : 40MHz
  SPI Mode       : QIO
  SPI Flash Size & Map: 32Mbit(1024KB+1024KB)
jump to run user1 @ 1000

OS SDK ver: 1.4.0(c599790) compiled @ Feb 26 2016 11:08:14

这是怎么回事呢?

Her Mary
Posts: 453
Joined: Mon Oct 27, 2014 11:09 am

Re: RTOS为什么编译出来的SPI_MAP显示不对呢?

Postby Her Mary » Fri Jul 22, 2016 10:48 am

flash download tool 烧录工具上的 flash size 选项,没选对吧?

tobewinner
Posts: 45
Joined: Tue Jan 19, 2016 2:39 pm

Re: RTOS为什么编译出来的SPI_MAP显示不对呢?

Postby tobewinner » Fri Jul 22, 2016 11:00 am

Her Majesty wrote:flash download tool 烧录工具上的 flash size 选项,没选对吧?

烧写工具2.4,烧写以下几个文件
blank 0xFE000
init 0xFC000
boot 0x0
user1 0x1000
选项如下:
CrystalFreq 40M
SPI SPEED 40M
SPI MODE QIO
FLASH SIZE 8Mbit
勾选SpiAutoSet
不勾选DoNotChgBin

Her Mary
Posts: 453
Joined: Mon Oct 27, 2014 11:09 am

Re: RTOS为什么编译出来的SPI_MAP显示不对呢?

Postby Her Mary » Fri Jul 22, 2016 2:02 pm

勾选SpiAutoSet

对比了一下我的,没啥差别,就是这个改成 不勾选 呢?

tobewinner
Posts: 45
Joined: Tue Jan 19, 2016 2:39 pm

Re: RTOS为什么编译出来的SPI_MAP显示不对呢?

Postby tobewinner » Sat Jul 23, 2016 2:39 pm

使用1.2的boot会显示正确的Flash大小:
2nd boot version : 1.2
SPI Speed : 40MHz
SPI Mode : QIO
SPI Flash Size : 4Mbit
jump to run user1

怎么回事呢?1.5有问题吗?

tobewinner
Posts: 45
Joined: Tue Jan 19, 2016 2:39 pm

Re: RTOS为什么编译出来的SPI_MAP显示不对呢?

Postby tobewinner » Sat Jul 23, 2016 4:32 pm

问题找到了,使用FLASH_DOWNLOAD_TOOLS_v2.4_150924的烧写工具,发现烧写后flash中关于SPI_MAP的不对:
这个是官方的定义

Code: Select all

Definition:

# write flash bin header
#============================
# SPI FLASH PARAMS
#-------------------
#flash_mode=
# 0: QIO
# 1: QOUT
# 2: DIO
# 3: DOUT
#-------------------
#flash_clk_div=
# 0 : 80m / 2
# 1 : 80m / 3
# 2 : 80m / 4
# 0xf: 80m / 1
#-------------------
#flash_size=
# 0 : 512 KB (256 KB + 256 KB)
# 1 : 256 KB
# 2 : 1024 KB (512 KB + 512 KB)
# 3 : 2048 KB (512 KB + 512 KB)
# 4 : 4096 KB (512 KB + 512 KB)
# 5:2048 KB (1024 KB + 1024 KB)#support in sdk 1.0.2
# 6:4096 KB (1024 KB + 1024 KB)#support in sdk 1.0.2
# 7:4096 KB (2048 KB + 2048 KB)#support in sdk 1.0.2
#-------------------
# END OF SPI FLASH PARAMS
#============================
byte2=int(flash_mode)&0xff
byte3=(((int(flash_size)<<4)| int(flash_clk_div))&0xff)

而程序读出来的前4个字节却是E9 03 00 60
写了个小程序将前四个字节改为E9 03 00 20就显示正确了(显示错误的时候,OTA在线升级就不能正常工作了)

Who is online

Users browsing this forum: No registered users and 10 guests