DongshanPI-D1s 烧录tina linux到spinor存储器后,无法通过xfel在编程了
-
如题,刚拿到dongshanpi-d1s的时候里面默认烧录的linux系统,在按照教程安装完驱动后,通过xfel工具可以编程例程中的执行代码到spinor存储器,但是我自己编译了tina linux烧录到spinor 存储器后,xfel可以识别设备,执行的结果似乎是正确,但是spinor存储器中的内容却没有任何变化,重启后,还是启动之前编程的tina linux,不知道是为什么,请求解答。
-
我遇到了相似的问题,不知道是什么问题,希望了解的人可以提示一下
-
-
我们也发现了这个问题,目前怀疑是 xfel无法完整擦除 spi nor导致的错误,可以尝试先使用 凤凰烧写工具 烧写一下 这个镜像,之后再通过 xfel去下载裸机程序,就可以正常使用了!
一定要选择 为 分区擦除升级
镜像文件: rtos_16M.img正常输出
-
@baiwen 烧录img后能用xfel写入一次,之后又不可以了,裸机程序
-
使用xfel擦除norflash无效
-
@qinchangzu xfel的bug,有兴趣可以帮忙修复下
-
@yuzukitsuru https://bbs.aw-ol.com/topic/3380/d1s-meils烧录导致xfel工具烧写失效/17
估计是这个问题,spi nor flash 被melis代码lock了。unlock下,应该就可以解决问题
-
@tripod9 是这个原因
-
@qinchangzu 打这个补丁,可以帮忙测试下,看是否解决问题了
diff --git a/spinor.c b/spinor.c index 7a30307..8cc6e95 100644 --- a/spinor.c +++ b/spinor.c @@ -287,6 +287,85 @@ static inline int spinor_info(struct xfel_ctx_t * ctx, struct spinor_pdata_t * p return 0; } +static inline uint8_t spinor_read_sr3(struct xfel_ctx_t * ctx, struct spinor_pdata_t * pdat) +{ + uint8_t tx[1]; + uint8_t rx[1]; + + tx[0] = 0x15; + rx[0] = 0x0; + fel_spi_xfer(ctx, pdat->swapbuf, pdat->swaplen, pdat->cmdlen, tx, 1, rx, 1); + return rx[0]; +} + +static inline int spinor_global_unlock(struct xfel_ctx_t * ctx, struct spinor_pdata_t * pdat) +{ + uint8_t cbuf[256]; + uint32_t clen = 0; + uint8_t sr3 = spinor_read_sr3(ctx, pdat); + + /* spi select */ + cbuf[clen++] = SPI_CMD_SELECT; + /* write enable */ + cbuf[clen++] = SPI_CMD_FAST; + cbuf[clen++] = 1; + cbuf[clen++] = pdat->info.opcode_write_enable; + /* spi deselect */ + cbuf[clen++] = SPI_CMD_DESELECT; + + /* spi select */ + cbuf[clen++] = SPI_CMD_SELECT; + /* global block/sector unlock */ + cbuf[clen++] = SPI_CMD_FAST; + cbuf[clen++] = 1; + cbuf[clen++] = 0x98; + /* spi deselect */ + cbuf[clen++] = SPI_CMD_DESELECT; + + /* spi select */ + cbuf[clen++] = SPI_CMD_SELECT; + /* wait busy */ + cbuf[clen++] = SPI_CMD_SPINOR_WAIT; + /* spi deselect */ + cbuf[clen++] = SPI_CMD_DESELECT; + + /* spi select */ + cbuf[clen++] = SPI_CMD_SELECT; + /* write enable */ + cbuf[clen++] = SPI_CMD_FAST; + cbuf[clen++] = 1; + cbuf[clen++] = pdat->info.opcode_write_enable; + /* spi deselect */ + cbuf[clen++] = SPI_CMD_DESELECT; + + /* spi select */ + cbuf[clen++] = SPI_CMD_SELECT; + /* write status 3 and clear wps bit */ + cbuf[clen++] = SPI_CMD_FAST; + cbuf[clen++] = 2; + cbuf[clen++] = 0x11; + cbuf[clen++] = sr3 & ~(0x1 << 4); + /* spi deselect */ + cbuf[clen++] = SPI_CMD_DESELECT; + + /* spi select */ + cbuf[clen++] = SPI_CMD_SELECT; + /* wait busy */ + cbuf[clen++] = SPI_CMD_SPINOR_WAIT; + /* spi deselect */ + cbuf[clen++] = SPI_CMD_DESELECT; + + /* end */ + cbuf[clen++] = SPI_CMD_END; + if(clen <= pdat->cmdlen) + { + fel_chip_spi_run(ctx, cbuf, clen); + return 1; + } + return 0; +} + + static int spinor_helper_init(struct xfel_ctx_t * ctx, struct spinor_pdata_t * pdat) { uint8_t cbuf[256]; @@ -370,6 +449,7 @@ static int spinor_helper_init(struct xfel_ctx_t * ctx, struct spinor_pdata_t * p if(clen <= pdat->cmdlen) { fel_chip_spi_run(ctx, cbuf, clen); + spinor_global_unlock(ctx, pdat); return 1; } }
-
-
@tripod9 xfel-windows-v1.3.0.7z 试试这个xfel,看是否解决问题了
-
@tripod9 目前是解锁后,再清楚状态寄存器3就好了
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号