Due to the argument ptr, coming in pointing to the address 0x1100 0044. As far as I understand, this is most likely causing the hard fault error because that address is in the 'reserved' sector of memory according to the device user manual (UM10470, pg 879 figure 171 'Map of Lower Memory'). so its not really allowed to use a pointer pointing to it.
As stated before, this doesn't happen when I step through the program rather than running it. If the program is stepped through, when I reach this function, the address to which ptr points is 0x1000 4416, the correct starting address of the buffer I want to point to, and in the local static ram section of memory instead (see previously mentioned diagram).
Can anyone advise me on any or all of the following things? 1.why there's this difference of behaviour between debug running and stepping 2. why the address to which the pointer points is being changed to this reserved address without my consent? 3. Is my interpretation of the hard fault error correct? 4. General things/ useful documentation to read - if from reading this post it seems like I'm not entirely sure what I'm talking about you are correct.