External Mode error for de10 nano
5 views (last 30 days)
Show older comments
I have created the hardware configurations reuired following the tutorial here: https://www.mathworks.com/videos/custom-target-development-for-arm-cortex-a-part-6-external-mode-feature-121177.html?s_tid=vid_pers_recs
While trying to test external mode, it fails with the following error:
Error occurred while executing External Mode MEX-file 'ext_comm': Failed to connect to the target. Possible reasons for the failure:
a) The target is not switched on.
b) The target is not connected to your host machine.
c) The application for the model is not running on the target. You might have clicked the Stop button. If the Run button is not dimmed, click it. Otherwise, click the Build button, which downloads and runs your application on the target.
Caused by: An error occurred attempting to open an rtIOStream. More detail may be reported in the MATLAB command window
Which is weird because none of the reasons (a), (b) and (c) is true.
Any help will be appreciated.
I looked inside the .elf and .log file that was deployed to the board and it has the following stack trace.
.log file
Error occurred getting packet header.
Error occurred in rt_PktServerWork.
Disconnecting from host!
.elf file
Simulation finishedExtGetHostPkt() failed.
Previous pkt from host thrown away due to lack of memory.
ExtSetHostPkt() failed for 1st EXT_CONNECT_RESPONSE.
ExtSetHostPkt() failed for 2nd EXT_CONNECT_RESPONSE.
ExtSetHostPkt() failed.
Could not create external mode user data. Out of memory.
SendPktDataToHost() failed on data upload.
Error occurred getting packet header.
received invalid packet.
Error occurred in rt_PktServerWork.
Disconnecting from host!
Error sending EXT_MODEL_SHUTDOWN packet to host.
Error calling rt_ExtModeInit!
Error processing External Mode command line arguments: %susage: model_name -tf <finaltime> -w -port <TCPport>arguments: -tf <finaltime> - overrides final time specified in Simulink (inf for no limit). -w - waits for Simulink to start model in External Mode. -port <TCPport> - overrides 17725 default port in External Mode, valid range 256 to 65535.▒-tf-port%200sinf%lf%1sfinaltime must be a positive, real value or inf
Usage: model_name -option1 val1 -option2 val2 -option3 ...
-tf 20 - sets final time to 20 secondsUnexpected command line argument: %s
**warning: the simulation will run with no stop time due to external mode with '-tf inf' argument.
** starting the model **Call to timerfd_create failed.
timerfd_createCall to %s returned error status (%d).
timer_settimeread(timerfd)my_sem_waitpthread_attr_setschedparampthread_attr_setinheritschedpthread_attr_setdetachstatepthread_attr_setstacksizepthread_attr_setschedpolicypthread_attr_setaffinity_nppthread_createpthread_sigmasksigaction to register a signal handlersigaction to restore default signal handlersched_setaffinityYou must have root privileges to run the generated code because
generated code requires SCHED_FIFO scheduling class to run correctly.
Try running the executable with the following command: sudo ./<executable name>
sem_init:baserateTaskSemSemsem_init:stopSemsched_setschedulerpthread_attr_getstacksize-w-ignore-arginitConnectionData:UDPData malloc failed.initConnectionData:createUDPPacketBuffer failed.initConnectionData: udpmaxpacketsize must bePuTTYPuTTYPuTTYPuTTY less than %d
initConnectionData: udpmaxpacketsize must be larger than %d
initConnectionData:ServerData malloc failed.Connection id %d, protocol: TCP/IP
Connection id %d, protocol: UDP/IP
Connection id %d, maxPacketSize: %d
Connection id %d, isUsingSeqNum: %d
initConnectionData:invalid protocol.Connection id %d, udpSendBufSize: %d
Connection id %d, udpRecvBufSize: %d
Connection id %d, blockingRecvTimeout: %d
Connection id %d, type: server
Connection id %d, server info file: %s
Connection id %d, type: client
Connection id %d, socket id %d
Connection id %d, server port: %d
getConnectionID: All %d available connections are in use.
createUDPPacketBuffer:UDPPacketBuffer malloc failed.createUDPPacketBuffer:UDPPacketBuffer buffer malloc failed.No receive sequence number found.Received UDP packet with sequence number: %u
UDP packet sequence number mismatch. Expected #: %u, Actual #: %u
Sent UDP packet with sequence number: %u
socket() call failed.setsocketopt() call failed.setsocketopt() TCP_NODELAY call failed.setsocketopt() SO_SNDBUF call failed.setsocketopt() SO_RCVBUF call failed.bind() call failed: %s
getsockname() call failed: %s
aUnable to open output file to write server port number: %s
Server Port Number: %d
Server port number is: %d
Unable to write server port number to output file: %s
Server port number is: %d
Unable to close output file after writing server port number: %s
listen() call failed.accept() for comm socket failed.initialUDPServerRecvfrom() failed.Server connect() failed.gethostbyname() call failed.-hostname-port%d%1s-client1-blocking-verbose%d-recv_timeout_secs-server_info_file-protocolTCPUDPUDP_PACKET_LOSS_DETECTION-udpmaxpacketsize-udpsendbuffersize-udpreceivebuffersize-The argument '%s' passed to rtiostream_tcpip is not valid and will be ignored.
socket() call failed for comm socket.Attempting to establish connection with hostname '%s' through port %d.
%srtIOStreamOpenrtIOStreamSend (connection id %d): size = %lu, sizeSent = %lu: %02x rtIOStreamRecv (connection id %d): size = %lu, sizeRecvd = %lu: rtIOStreamClose (connection id %d)
Simulation finishedstopping the modelCall to %s returned error status (%d).
pthread_join▒m▒U▒d
0▒▒▒▒p▒Ѓ
▒
▒ 8▒ ▒▒▒o▒▒▒▒o▒▒▒o*▒
▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒d▒<▒D▒P▒X▒`▒h▒t▒|▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒ؒ
Error in UploadLogInfoInit(). Most likely a memory
allocation error or an attempt to re-initialize the
signal selection during the data logging process
(i.e., multiple EXT_SELECT_SIGNAL packets were received
before the logging session terminated or an
EXT_CANCEL_LOGGING packet was received)
Error in UploadInitTrigger(). Most likely a memory
allocation error or an attempt to re-initialize the
trigger selection during the data logging process
(i.e., multiple EXT_SELECT_TRIGGER packets were received
before the logging session terminated or an
EXT_CANCEL_LOGGING packet was received)
0 Comments
Answers (0)
See Also
Categories
Find more on Texas Instruments C2000 F28M3x Concerto Processors in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!