memset doesn't work as usual in SDK17.0.2

Hey all, I'm trying to get the NRFX_SPIM driver to work correctly (probably a different thread for some of these issues) but I'm getting an error NRF_ERROR_INVALID_ADDR, which apparently means that my rx buffer is not in data RAM so that EasyDMA can't access it.  I though maybe if I memset the buffer, then it will move it to RAM, so I have the following code:

#include <string.h>


static uint8_t rx_buff[2];
static const size_t rx_length = sizeof(rx_buff);

memset(rx_buff, 0, rx_length);

This returns the error: 

expected ')' before numeric constant

I am not new enough to C to get this wrong I think... If I comment it out everything runs fine, and rx_buff isn't a macro, so I'm kind of out of ideas.  Did I do something stupid here?

  • I should have mentioned that this is in segger on windows 10, and that it is my adapting the ble_app_template example.  I should also say that I get "Symbol 'memset' not found" when I try to go to definition/declaration.  I thought that maybe not pointing to the standard libs was the problem - they are in the segger program files directory.  But even after adding that to my User Include Directories in the preprocessor, I still get the same issues.

  • OK, I'm an idiot. I was calling memset from global without thinking.  I have brain fatigue.  This isn't the post you're looking for.  Move along.

  • I'm sure nobody else has ever done anything like that ...


  • I was looking to set it as answered, but I don't have that option... Do I need to leave it up for a certain amount of time before I can mark it answered?