• AVR Freaks

AnsweredHot!Error when building code that includes SPI BUS block (PIC32)

Author
Darc
New Member
  • Total Posts : 9
  • Reward points : 0
  • Joined: 2019/08/23 19:29:13
  • Location: 0
  • Status: offline
2019/08/28 11:08:14 (permalink)
0

Error when building code that includes SPI BUS block (PIC32)

Hello,
 
I am attempting to send data from a PI32MK PIM over SPI to a raspberry pi. I have a basic simulink model designed but I encounter errors when building the model. If I comment out the SPI block and related process the model builds fine. I do not know if the error is due to improper use of the SPI Bus block or something else. I would appreciate guidance or recommendations on where I can learn more about the use of an SPI Bus block (I have already looked at the example UDB5_33FJ256GP710A_SPI_MPU6000_SensorTest.mdl).
 
I am using R2019a with blockset 3.45.02 and compiling for PIC32MK Motor Control PIM. I have included my code and the diagnostics Viewer.

Attached Image(s)

#1
Lubin
Moderator
  • Total Posts : 375
  • Reward points : 5
  • Joined: 2007/03/31 07:38:15
  • Location: Bayonne, France
  • Status: offline
Re: Error when building code that includes SPI BUS block (PIC32) 2019/09/20 04:34:30 (permalink) ☼ Best Answerby Darc 2019/10/03 15:25:30
0
Thanks for the detailed report with example.
 
The reported problem (typo on register name) affect only the Slave mode. Fix will be published with the next release (following V3.45.04)
 
Lubin
 
#2
Darc
New Member
  • Total Posts : 9
  • Reward points : 0
  • Joined: 2019/08/23 19:29:13
  • Location: 0
  • Status: offline
Re: Error when building code that includes SPI BUS block (PIC32) 2019/09/20 11:08:34 (permalink)
0
Hi Lubin,
 
We installed 3.45.04 and tried compiling code with the SPI block and slave select built with Simulink 2019a for Pic32MK0512MCF100 but had an error. It seems to be a typo in the register name. The error is:
 
test13_pinsforHipExo_main.c:70:3: error: 'SS1_inR' undeclared (first use in this function)
  SS1_inR = 0x00;
  ^
We can fix this error by changing "SS1_inR" to "SS1R".
 
 
#3
Jump to:
© 2019 APG vNext Commercial Version 4.5