This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

if (!nrfx_is_in_ram(buf)) causes Reset

I testing UART0 data transmossion. But, could resolve why CPU resets when executing : if (!nrfx_is_in_ram(buf)) in uart_nrfx_uarte.c file. See atached image, where Reset occurs.

  • Hi, 
    Can't answer your question, really, but had a peak and it seems the nrfx_is_in_ram is just an inline:

    return ((((uint32_t)p_object) & 0xE0000000u) == 0x20000000u);

    So just casting as an int and checking if the upper three bits are 010... I guess it could be simply accessing the buf from this interrupt is causing the crash (?) but the only other possibilities I can think of is that returning ENOTSUP here is deadly... which both seem pretty unlikely, since they do just that in the implementation from zephyr/drivers/serial/uart_nrfx_uarte.c in my build env.

    My first guess would be that the crash is actually happening elsewhere.  How did you determine that this is the source of the crash?  Anyway to debug, stop just before that point and see what's in buf?  And when you step over the next line, it dies?

  • Hi, while debugging, I reached upto the library function, 

    n_ra

    and there, as per formula, evaluated the result. The buffer address was 20001172....after logical AND with E000,0000 .. it is 2000,0000. So, the function must return. It seems, the program crashes during AND operation of the contents. 

  • Heh, sounds like you need to make sure the data is in RAM before calling the function that tells you if the data is in RAM.

  • Hi, there is function in my code : send_uart0(unsgigned char *buf). This function works very well in whole program and has been used many times to send data to URAT0. But, at a particular only, it causes such error. The same has been varified to be in RAM. The buf has been allocated at compile time. 

Related