How to Implement I2C on Chopstx?

tomli at tomli.me tomli at tomli.me
Thu Aug 23 04:57:48 CEST 2018


Hi gniibe,

Recently I've done a little bit of further research about using an additional
ATECC508A crypto chip for improved security. Although there are some difficulties
but I was able to hack a solution, now the results looks promising. I will
publish the technical details after I finish my reseach. I was working on the
software protocol part and all the development was done on GNU/Linux. 

Now, logically the next step would be working with the actual hardware. In order
to control the chip, an I2C driver should be implemented in Chopstx. But I don't
understand the design and architecture of Chopstx, nor have any experience about
working on the "bare-metal" STM32 hardware without using a high-level HAL library
like STM32Cube or libopencm3, I have lots of things to learn.

From my understanding, the I2C subsystem on STM32F103 has three modes, polling,
interrupt, and DMA. Since I2C communication is only needed just before the private
keys are decrypted by DEK - at this point there is no other tasks to do - I think
we don't need to use interrupt or DMA to implement non-blocking asynchronous
I2C operation, we can block the whole firmware and perform I2C reads/writes by
busy-waiting and polling until we finish the job. 

But I don't understand about how interrupts, threads, context-switching or USB
communication is handled in Chopstix. Is it really okay to implement I2C in this
way? Is it going to break other things in Chopstx? Do you have more suggestions
and resources for the I2C implementation?

Thanks,
Tom Li

Beijing GNU/Linux User Group
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 851 bytes
Desc: Digital signature
URL: <https://lists.gnupg.org/pipermail/gnuk-users/attachments/20180823/8dc02881/attachment.sig>


More information about the Gnuk-users mailing list