Teensy4 Hardware Interrupt Problem

조회 수: 14 (최근 30일)
Soner
Soner 2025년 10월 14일 19:16
댓글: Soner 2025년 10월 15일 11:56
Hello community,
I installed simulink hardware support package for Arduino. Created a new model, selected Teensy 4.1. I selected Hardware Interrupt block. Put it in the model. Selected the CAN3_Handler.
Created a function call subsystem. Inside it I put onboard CAN recieve and selected CAN3.
Im getting this error which I couldnt understand:
Error evaluating 'InitFcn' callback of HardwareInterrupt block (mask) 'untitled/Hardware Interrupt'.
Callback string is 'codertarget.arduinobase.conflictcheck.validateandregisterBlocks(gcbh);
matlabshared.svd.internal.interruptBlockMask(gcb,'blockInitFcn');'
Caused by:
Hardware Interrupt block 'untitled/Hardware Interrupt' is not supported on the Teensy 4.1 (Arduino Compatible) hardware board.
You can either change the Arduino hardware or remove the Hardware Interrupt block from model and try again.
I already selected Teensy 4.1 as a target but I dont understand the error. This block seems to be created specifically for Teensy 4.1 but it says it is not supported. What am I missing here?
Thanks in advance,

답변 (1개)

Walter Roberson
Walter Roberson 대략 16시간 전
편집: Walter Roberson 대략 16시간 전
The CAN receive block is supported on a variety of Arduino hardware. The Teensy is not on the list of supported hardware.
The block you found is not specific to Teensy: it is for Arduino, but not all ardunino is supported.
  댓글 수: 3
Walter Roberson
Walter Roberson 2025년 10월 15일 2:14
편집: Walter Roberson 2025년 10월 15일 2:16
I see.
Could you confirm that you are using the block described at https://www.mathworks.com/help/simulink/supportpkg/arduino_ref/hardwareinterruptadvancedteensy4.html ? I notice the one there is labeled "CAN1 Handler" (not CAN3 Handler), and has a block name of "Hardware Interrupt" (absent from your diagram.)
Soner
Soner 대략 4시간 전
yes I confirm Im using that block and if you look closely in the screenshot thats the Hardware Interrupt block. when you click elsewhere in the model, the name is hidden. Inside the block there are 3 options. CAN1_Handler,CAN2_Handler,CAN3_Handler. I need this for CAN3 and I selected CAN3_Handler. I put the onboard can receive block inside a function call so that I can call the receive block when there is a message.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

제품


릴리스

R2025a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by