Not able to read SPI and COM PORT access denied

Hi,

I am developing an application to read the ADXL355 via SPI. I have not been able to read the register of my accelerometer. And I don't know why. 
I tried reading the register of the device ID, but I still got 0. Maybe it is a hardware problem.
I built the application and suddenly I was not able to print messages to the port anymore "COM3: Access denied".
I checked the device tree file and I see this messages, I am not sure if these are the cause of not being able to read the registers and of the com port error:



I will also add a zip file of my project in case it is useful.

2664.SPITry9.zip

Thank you very much.

Adrián Lopez Vudoyra.

---------------------------------------------------------------------

Edit, I restarted the computer and the COM Port works now. I am still not able to read the registers. I tried reseting the device first and then reading, but it is still not returning anything. I thought of it being a hardware problem, but wouldn't it return an error at some point in the init()?

  • Hi,

    First, 0x40000.... means that this peripheral has not been enabled for NS (non secure) variant, you should get CPU crash in this case.

    Would suggest starting with existing driver such as ADXL362 (read and verify the ID).

    Also read the raw value from SPI read, if you get 0xFF, then something wrong with the SPI read itself, try lowering SPI clock.

    Can you physically trace SPI signals ?

    Lastly, not entirely sure using `printk` inside the driver is a good idea.

    Thanks,
    Reuven

  • Hi Reuven,

    Thank you so much for your answer. 

    peripheral has not been enabled for NS (non secure) variant, you should get CPU crash

    Where should I be getting the CPU crash here? Because in my program everything proceeds as normal, it just prints 0x00.

    lso read the raw value from SPI read, if you get 0xFF

    I tried debugging the init function, I am getting 0x00 as a value. In all of the registers that I have tried to read.

    Can you physically trace SPI signals ?

    I saw in the Lesson 5 exercise 1 of the intermediate ncs SDK that there was a tool to do so, but they did not say the name. Which tool would you recommend me? Do I need a tool(Multimeter)? Or can I do it directly with my computer?

    not entirely sure using `printk`

    Would it be better if I used LOGINF then? I used printk because it is being used in the Lesson7 exercise 1 of the same course previously mentioned

    Thank you very much. 

    Adrian Lopez Vudoyra

  • Adrian1504 said:
    I saw in the Lesson 5 exercise 1 of the intermediate ncs SDK that there was a tool to do so, but they did not say the name

    We used Saleae Logic Analyzer for that, but we cannot recommend our customers for any specific vendor. Also, different such products should be available in the market.

    How does your hardware look like? Yes, mostly it is a bad / incorrect / loose connection or a hardware issue.

Related