你好,
我们有问题从I2C EEPROM引导我们的设备。一般来说,微控制器似乎崩溃(或取消)它的启动过程和设备不承认我们的PC.问题没有出现在超速资源管理器套件,所以这部分是我们的错,但我们没有主意时,它是为了了解正在发生的事情。
我们有一个自定义板与CysB3012 BZXC微控制器从ST I2C内存启动(M24M02-DR)。两个芯片都类似于SSEK的芯片,虽然部件号是不同的。我们正在使用1.2V的功率用于微控制器(也可以处理1.8V,我认为)。I2C驱动在100kbPs。我们使用USB3电缆和端口,应该根据数据表在USB2模式下引导微控制器。微控制器处于I2C EEPROM启动(‘1ZZ’)中,我认为这是硬编码的,我们不能只在USB和I2C上随意改变它。
我们的第一个固件测试是在一个预制的例子中改变USB描述符,以显示我们可以重新编程。我们还尝试从示例中删除RTOS(而不是在主()中放置测试代码),并使用不同的未修改示例。改变USB描述符似乎是有效的,但我们不能确认玩RTOS实际上是有效的(我们不能得到LED闪烁)。
这是我们尝试过的,我们可以从测试中看出:
我们在代码中添加了一个适合内存大小的定义。这是在我开始工作之前完成的,所以我只能相信代码就是这样。
在BooSt选项文档之后,我们改变了默认的ELF2IMG参数,以适应我们的内存大小,并将I2C速度更改为100KbPs。当我们检查第一个图像头读到时,这似乎已经起作用了。
在SSEK上,从I2C存储器引导导致设备被识别。我们定时I2C
通信大约需要10秒。对RAM编程直接导致相同的结果。
在我们的板上,直接对RAM进行编程,使设备能够正确地识别它的新名称。编程I2C显示成功,I2C线确实是活着的,同时正在进行重新编程。
然而,当我们尝试启动时,通信在大约1.5秒后停止,线路和设备出现死机。在这两种情况下,我们都使用相同的图像。这是为我们的板的内存芯片配置。
一旦
电源接通,3.3V和1.2V的供电以及微控制器的主时钟在任何时候都是清晰和稳定的。
有什么想法,我们可以尝试下一步或可能发生什么?
我认为这是我们目前所拥有的,如果需要更多的信息,或者如果这个帖子不清楚,请随时对我大喊大叫,我会澄清这一点。
编辑:自从写这篇文章后,我们注意到I2C标题显示的大小是32 KB。然而,问题在改变之后仍然存在。
编辑:
新增I2C内存示意图(17-10-2017)
第二版
27.3 K
以上来自于百度翻译
以下为原文
Hello,
We are having problems boo
ting our device from an I2C EEPROM. Broadly speaking, the microcontroller seems to crash (or cancel) it's boot procedure and the device is not recognized by our PC. The problem does not appear on the SuperSpeed Explorer Kit, so part of this is our fault, but we are out of ideas when it comes to understand what is happening.
We have a custom board with a CYUSB3012-BZXC microcontroller booting from a ST i2c memory (M24M02-DR). Both chips are similar to the ones from the SSEK, although the part numbers are different. We are using 1.2V power for for Microcontroller (which can also handle 1.8V I think). I2C is driven at 100kBps. We are using an USB3 cable and port, altought the microcontroller should be booting in USB2 mode according to the datasheet.The microcontroller is in I2C EEPROM boot ('1ZZ), I'm affraid this is hardcoded and we can't change it at will beyond USB-only and I2C-only.
Our first firmware test was changing the USB descriptor in a premade example to show we could reprogram it. We have also tried removing the RTOS from the example (instead placing test code in main()) and using different unmodified examples. Changing the USB descriptor seems to work, but we couldn't confirm that playing with the RTOS actually worked (we couldn't get a LED flashing).
Here's what we have tried and what we can tell from our testing:
We added a define in code to fit the memory size. This was done before I started workiing on this, so I can only trust that this is what the code was meant to be.
Following the BootOption documentation, we changed the default elf2img arguments to fit our memory size and changed the I2C speed to 100kBps. This appears to have worked when we check the first image header read.
On the SSEK, booting from the I2C memory leads to the device being recognized. We timed the I2C communication to take around 10 seconds. Programming the RAM directly leads to the same result.
On our board, programming the RAM directly makes it so that the device is recognized correctly with it's new name. Programming the I2C shows success and the I2C lines are indeed alive while reprogramming is being done.
When we try to boot, however, the communication stops after around 1.5 seconds and the line and device appear dead. We are using the very same image in both case. Which is configured for our board's memory chip.
The 3.3V and 1.2V alimentations as well as the microcontroller's main clock are clear and stable at all time once power is on.
Any ideas on what we can try next or what might be happening?
I think this is all we have so far, if more informations are needed or if this post is unclear, feel free to shout at me and I'll clarify this.
EDIT : Since writing this post, we have noticed that the I2C header showed a size of 32kb. However, the problem is still there after changing it.
EDIT:
Added i2c memory schematic (17-10-2017)