Jump to content

mukululul

Members
  • Posts

    3
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi, thank you very much for your detailed answer. You nailed it with your last line. It is a alignment problem. I was using a static buffer allocated by the compiler of course it was nicely aligned. I am storing the calibration data in that buffer plus a header infront. This header is 3 bytes which is, I agree not very smart ;-) I will change the headersize then the return pointer is aligned again. Thanks again. Michael
  2. Hello, after finally getting the EEPROM working which now holds the calibration data for the touchpad I get a hardfault. When the data is retrieved with ginput_lld_mouse_calibration_load(). The function returns a const char* to the previously saved calibration data. The code now casts to the struct Calibration* and stores the pointer in pc. Then pc is dereferenced using the [] operator (same as *pc); This causes the compiler to generate code which copies the struct completely. While executing this code I get a hardfault on a STM32F103ZET. Exchanging the compiler generated code with memcpy all works fine. if (MouseConfig.fnloadcal && (pc = (Calibration *)MouseConfig.fnloadcal(instance))) { //MouseConfig.caldata = pc[0]; memcpy(&MouseConfig.caldata,pc,sizeof(MouseConfig.caldata)); MouseConfig.flags |= (FLG_CAL_OK|FLG_CAL_SAVED); if ((MouseConfig.flags & FLG_CAL_FREE)) Anybody here who can explain this? My compiler ist arm-none-eabi-gcc.exe (GCC) 4.7.2. Thanks for your help. Regards Michael
×
×
  • Create New...