This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28054F: TI Motorware 1.01.00.18: Make struct USER_Params as const

Part Number: TMS320F28054F

Hello,

is it possible to split the struct USER_Params from userParams.h into to 2 structs:

  • one with all variables without errorCode as const, so that it is put into flash
  • one that only contains the errorCode

I checked everything. The only one is the Estimator function CTRL_setEstParams, which uses the struct USER_Params. The function is in the estimator lib. Does this function write to the struct USER_Params or not. When not I can split it and give the function CTRL_setEstParams the pointer of the flash-struct.

Thanks for answering

regards

David

  • No, you can't change and add any variable in the struct since the struct is used in the FAST estimator.  Yes, you can define it to const and store it in flash, but you have to change the function in user.c to assign the related value to the const struct object directly.