This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf52805 secure bootloader causes the i2c(twi) not to work

Hello,

I am using nrf52805 processor, nrf sdk v16.0.0 and Segger embedded studio. My board communicates with a temperature sensor over I2C. The software is working without problem when I don't upload settings and bootloader hex files. I am getting i2c interrupts without problem. However, when I also upload settings and bootloader hex files, the communication with i2c sensor is broken. I cannot get any i2c interrupts. The only difference is bootloader and setting hex files that are uploaded. By the way, the secure bootloader works without problem. The situation is so urgent and the problem is so silly. Can somebody help me?

Best regards.

Parents
  • Hi,

    The application and bootloader are completely independent, but a possible explanation could be if the bootloader uses some hw resources and does not completely clean up before branching to the application. In that case, something could be in a bad state. (Typically you would write the app to initialize things from the default reset state, and if some registers are not in that state it could cause problems). It is difficult to pinpoint more directly, but I would start by looking at the pins connected to your I2C device, and see if you use the TWIM or TWIS peripheral in the bootloader an app? You could also attack this from a different angle, by stopping execution in the beginning of your app and look at relevant HW registers and see if there is a difference between when using bootloader or not to try to narrow down where there is an issue.

  • Hi Einar,

    I tested it and I saw difference at CPU register when bootloader is installed. But, I don't know what is the meaning of this. How can I securely send you code to be tested by you ? Is this possible? I prepared everything. You will see that you cannot get even NACK ADDR interrupt after using bootloader. Also, I cannot see any signal from logic analyzer when I upload bootloader

    Thank you.

  • Hello,

    I found something new. For example, if scl and sda pins are 20 and 21 respectively, I cannot see any signal when I upload bootloader but it is working when I use only app and soft device.On the other hand, if scl and sda pins are 0 and 1 respectively, I can see i2c signal when I upload bootloader. By the way, I am using nrf52832-dk to emulate nrf52805. In nrf52805 side, i2c pins are also 20 and 21.

  • Hi Eliar,

    I am sorry for my mistake. The reason is that pin 21 is pin reset pin and I forgot to delete flag. So, I cannot get any interrupt. I solved the problem. Thank you.

Reply Children
No Data
Related