Sunteți pe pagina 1din 12

Tt nhin l c ri B, nu tham gia ng chng ta s

t chc gp mt v trao i. Bn c tm hiu dn cc


DEMO c sn i. Ci thm ADD-ON ny cng nhiu ci
hay (add-on ny chy trn matlab 2011b thi
nh): https://www.aimagin.com/forum/viewtopic.php?
f=2&t=269

Addon blockset for STM32F4 Target! Updated


19-2-2014 v2.5
Moderators: admin, memee
Post a reply
Search this topic

Search

87 posts Page 1 of 9 12345 ... 9


Addon blockset for STM32F4 Target! Updated 19-2-2014 v2.5
by srantonio Wed Jan 09, 2013 5:33 pm

License:
Licensed under Creative Commons License Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
http://creativecommons.org/licenses/by-nc/4.0/deed.en (English)
http://creativecommons.org/licenses/by-nc/4.0/deed.es (Spanish)

Licensed under Creative Commons License Attribution-NonCommercial 4.0 International (CC


BY-NC 4.0)
http://creativecommons.org/licenses/by-nc/4.0/deed.en (English)
http://creativecommons.org/licenses/by-nc/4.0/deed.es (Spanish)
Creative_Common_License_Beyond Control Blockset.png (9.33 KiB) Viewed 1776 times

Planned releases:

-Audio input/output, recording, etc... Audio output from ROM and RAM memory DONE! v2.4
-Timer Input Capture with Interrupts at each detected edge (each IRQ could execute different code!) DONE!
v2.3
-One Shot PWM mode
-Timer Interrupt programmable via time input
-Timer Interrupt without autoreload
-VGA data and graphical output
Changelog:
Updated 19-2-2014
Version 2.5 Final Release changes:
--------------------------------------------------FEATURES
---------------------------------------------------Added True Random Number Generator block (v2.5 , Update provided Examples)
-Added Audio Playback blockset(5 new blocks)! (v2.4)
(limitations: it cant support audio mixing, you cant play two or more samples
at same time; this situation produces white noise)
-Fixed all problems related to Matlab 64 bits (v2.3)
-Supports GNU-ARM and MDK-ARM compilers
-Supports 32 & 64 bits Matlab version
-Supports Matlab 2011 to Matlab 2013
(Matlab 2009 is compatible with some block display problems,
for these users a Matlab update is recommended)
-Timer Input Capture with configurable Interrupt function generator block
-Get Timer Input Capture Data, to recover measured Frequency, time between Edges
and Duty Cycle; for use with the previous block
-Dual IRQ feature, two totally different IRQ call-functions, one different IRQ per Edge is not supported by
Matlab,
anyway the code is well formed for this purpose
-Get Timer Input Edge Type, this feature is useful to distinguish the source of the
TIMER Input Capture IRQ, and enables to execute different
code for each IRQ edge type. ( v 2.31)
-Free Running Timer, Get Time Stamp and Reset Free Running Timer blockset,

ideal to compute time between events, to implement Lap Timer features,


measure time between External Interrupts...
-External Interrupt block
-Real-Time Multitasking via IDLE Task block, enables the usage of the microcontroller (MCU) free
time in the form of a low-priority thread that dont disturb real-time processes, now you can
execute large data analisys that takes longer than your smallest model sample time.
The result is a behaviour extremely similar to a Real-Time Operating System (RTOS).
-Real-Time Multitasking IDLE block accepts its own Execution Time Profiler
-Get IDLE Time block, ideal to compute the time spent on any part of your algorithm in the IDLE
subsystem
-Native Full Speed USB Virtual COM Port blockset supporting Large Data Packet Size (up to 16 KB per
packet, breaks the 64 Bytes barrier of USB, tested with 1 KB packets at 1KHz without any problem)
-PWM Input Capture block (you can use more than one PWM Input block per model)
-Execution Time Profiler (this not uses UART, it writes a Simulink data storage variable)
-Get time block, ideal to compute the time spent on any part of your algorithm
-Watchdog block, enables usage and configuration of the embedded watchdog
-USB HID Rx/Tx blocks (legacy purpose, its better use UBS VCP ones) for both Target and Host
-Lap Timer with controls, ideal to count time between events

Beyond Control v2.5 Library Blockset

--------------------------------------------------INCLUDED PATCHES
--------------------------------------------------*Runtime Libraries
This folder contains the required C++ runtime libraries for both 32 & 64 bits Windows system

*Uvision 5 Patch
Using a clear installation of Keil Uvision 5, the CMSIS folder tipically under C:\Keil\ARM lacks,
and Matlab will show an error related to "core_cm4.h" is not found.
In this case, copy the file "CMSIS.rar" included in the Uvision 5 Patch folder, into C:\Keil\ARM,
and uncompress it directly in Keil\ARM folder; a folder called CMSIS will be created.

*Windows 8 installation Patch


Install Waijung blockset into Windows 8 can be a little tricky one, probably due to some minor
changes in the desktop OS; in this case, copy the included directory "targets" into your Waijung
installation, overwitring one single file. Proceed with Waijung installation normally.
-------------------------------------------------------------------------------------------------INSTALLATION INSTRUCTIONS
-------------------------------------------------------------------------------------------------Installation instructions:
1- If you have an old UC3M Addon Blockset Beyond Control version
installed, remove it (delete Addons folder from Waijung folder)
prior to install this new version.
2- Go to your Waijung folder.
3- Copy the "addons v2.4 Beyond Control 32 & 64 Bits.rar" here.
4- Uncompress it directly, do not use or add directories.
5- Press "Yes" when system prompts about overwrite some files.
6- Add this: <Waijung_directory>\addons\UC3M to the Matlab Path.
Like this example: C:\waijung\Addons\UC3M

Enjoy it!

-------------------------------------------------------------------------------------------------Previous Releases Info


-------------------------------------------------------------------------------------------------Updated 10-22-2013
Version 1.91 "Beyond Control" changes:
-Added External Interrupt block
-Updates examples related to UC3M Addon Blockset v1.9 "Beyond Control" located at
"Waijung_dir\addons\examples"
-Fixed minor bug for a malformed script

Updated 10-11-2013
Version 1.8 "Beyond Control" changes:
-Added IDLE Task Block:

Creates a task function which runs during the available


CPU free time between real-time processes.
The task function runs the code of the downstream
function-call subsystem.
Consider the subsystem function as a low-priority thread,
ideal to compute larga data analysis without disturb
real-time control processes.
-Improves code generation process, fixed duplicate instances detection for some blocks

Version 1.61 changes:


-Fixed incompatibility issue between CAN Bus blocks and UC3M Addon Blockset.
-Added compatibility with Waijung 13.09a, we encourage the usage of this last Waijung release
Version 1.6 changes:

-Added Native Full Speed USB Virtual COM Port blockset supporting Large Data Packet Size[/b] (up to 16 KB per
packet, breaks the 64 Bytes barrier of USB)
(Tested with 1 KB packets at 1KHz without any problem)
-Added compatibility with Waijung 13.07a
-Fixes in a "rough" way a problem detected with Digital Output block,
a better fix will be released lately.
Advice: For version 1.61 and up. You must install the STM32 Native USB Com Port Drivers, in some
computers these drivers falls into an error code 19; the device cant startup due to some incorrect data
configuration, to solve this you must go to device administrator, select the STM32 Com Device, select
reinstall controller, I want to find the driver from a list, select STMicroelectronics Virtual Com Port, accept
it. Restar the device, the problem will be fixed forever in this computer.

Host model, reading and sending data at high rates to/from the Native USB Virtual Com Port

Target model, reading and sending data at high rates to/from the Native USB Virtual Com Port

Version 1.5 changes:

-Added support for IAR EWARM 6.5 and MDK-ARM 4.6


-Improved, and I think that almost all stability issues are solved
-Fixed unaligned data that prevents correct working of USB HID
(IAR EWARM appears to be pretty more robust than MDK-ARM about data alignment, I encourage the usage of IAR
EWARM)
-Fixed a problem that prevents source code compilation when UC3M Execution Time Profiler block is used.
-Fixed a problem that prevents source code generation for Waijung Regular ADC block, when Regular ADC is
used deeply into a subsystem.
Version 1.4 changes:
-Added new Stack memory recommendation
-Added recommendation of usage MDK-ARM 4.60 instead of 4.70a,
it fixes a lot of strange microcontroller crashes, now compiler optimization level 3 can be used for USB HID code
-Fixed minor bugs in Execution Time Profiler block
Version 1.3 changes:
-Fixed too many incompatibility issues with USB HID code generation, now it compiles and works in all
computers!
-Fixed unstability problems with PWM Input Capture block
-Enable Flash memory Prefetching by default
-Fixed a minor bug that prevents usage USB HID Rx/Tx blocks together
[/b]
---------------------------------------------------------------------Known issues:
-[b]For version 1.61 and up. You must install the STM32 Native USB Com Port Drivers, in some computers,
these drivers falls into an error code 19; the device cant startup due to some incorrect data configuration,
to solve this you must go to device administrator, select the STM32 Com Device, select reinstall controller, I
want to find the driver from a list, select STMicroelectronics Virtual Com Port, accept it. Restar the device,
the problem will be fixed forever in this computer.
-----------------------------------------------------------------

Features:
-External Interrupt block
-IDLE Task block, enables the usage of the microcontroller (MCU) free time in the form of a low-priority thread
that dont disturb real-time processes, now you can execute large data analisys that takes longer than your
smallest model sample time.
The result is a behaviour extremely similar to a Real-Time Operating System (RTOS).

-USB HID Rx/Tx blocks for both Target and Host


- Native Full Speed USB Virtual COM Port blockset supporting Large Data Packet Size (up to 16 KB per packet,
breaks the 64 Bytes barrier of USB)
(Tested with 1 KB packets at 1KHz without any problem)
-PWM Input Capture block (you can use more than one PWM Input block per model)
-Execution Time Profiler (this not uses UART, it writes a Simulink data storage variable)
-Lap Timer with controls, ideal to count time between events
These blocks are totally compatible with automatic code generation, compilation and flash programming; tested
using Keil compiler, IAR compiler and Matlab 2011b.
---------------------------------------------------------------------Installation instructions:
1- Go to your Waijung folder.
2- Copy the "Addons STM32F4 Target vX.X .rar" here.
3- Uncompress it directly, do not use or add directories.
4- Press "Yes" when system prompts about overwrite some files.
5- Add this: <Waijung_directory>\addons\UC3M to the Matlab Path. Like this example: C:\waijung\Addons\UC3M
Enjoy it!
Please leave feedback and report problems!

Download (v 2.5) :
https://mega.co.nz/#!rgpXACIT!w6DaQCM1g ... lTNmNUnaXA
ATTACHMENTS
addons v2.4 Beyond Control 32 & 64 Bits.rar
UC3M Addons Beyond Control 2.4 32 & 64 Bits
by Sr Antonio
(19.83 MiB) Downloaded 132 times
STM32 USB Com Port Drivers.rar
STM32 Virtual Com Port Driver - 32 & 64 bit OS
(11.06 MiB) Downloaded 311 times
Last edited by srantonio on Wed Mar 12, 2014 3:47 pm, edited 39 times in total.
srantonio

Posts: 169

Joined: Wed Mar 14, 2012 3:45 pm

T
o
p

Re: USB HID Rx/Tx Simulink blockset addon for STM32F4 Target
by krisada Wed Jan 09, 2013 6:46 pm

Congratulations! Great work.

krisada

Posts: 284
Joined: Tue Oct 04, 2011 11:55 pm

T
o
p

Re: USB HID Rx/Tx Simulink blockset addon for STM32F4 Target
by isururivi Sat Feb 16, 2013 11:20 pm

when I try to run "hid_host.mdl " (in the " USB HID Rx/Tx Simulink blockset addon for STM32F4 Target! "
example),the following 1st error massage was appeared
and also when I try to run that with only " HOST hid send " block the following 2nd error massage was appered
here I used 32bit computer and MATLABR2012b software
can anyone help me.
ATTACHMENTS
error massage.rar
(81.7 KiB) Downloaded 200 times
isururivi

Posts: 18
Joined: Sat Feb 16, 2013 10:52 pm

T
o
p

Re: USB HID Rx/Tx Simulink blockset addon for STM32F4 Target
by srantonio Mon Feb 18, 2013 3:34 pm

You will need to install "RapidSTM32", the blockset for STM32F10x target,
because the USB PC Host blocks are the same of RapidSTM32 blockset.
srantonio

Posts: 169
Joined: Wed Mar 14, 2012 3:45 pm

Re: USB HID Rx/Tx Simulink blockset addon for STM32F4 Target
by JensB Fri Feb 22, 2013 2:27 pm

T
o
p

Hi srantonio!
i just start to work with USB HID Rx/Tx Simulink blockset addon for STM32F4 Target but got some error messages
(see the attachment). Can you give me some hints, how to get starting? Im working on win7, 2012a and with
Keil.
Thanks a lot for your help!
ATTACHMENTS
errors.zip
(300.37 KiB) Downloaded 170 times
JensB

Posts: 28
Joined: Tue Apr 10, 2012 6:33 pm

T
o
p

Re: USB HID Rx/Tx Simulink blockset addon for STM32F4 Target
by srantonio Fri Feb 22, 2013 4:35 pm

I never try the autocompile feature, I always make a new project using Keil Uvision "manually".
I only generate C source code. And this addon blockset is only tested using Matlab 2011b 32 bit version;
is the only version of Matlab that I have installed.
Using Matlab 2011b 32 bit version, my addon blocksets works flawlessly.
srantonio

Posts: 169
Joined: Wed Mar 14, 2012 3:45 pm

Re: USB HID Rx/Tx Simulink blockset addon for STM32F4 Target
by JensB Wed Mar 13, 2013 3:01 pm

Hi again! I just got a autocompiled target version. Just starting the host part, i got a message concerning a have
to connect a FIO Std board or a valid RapidSTM32 device. I already compiled and downloaded the target part to
a F4 discovery board!
The error-message i put in the attachment. Can you give me some hint!?!
ATTACHMENTS

JensB

T
o
p

Posts: 28
Joined: Tue Apr 10, 2012 6:33 pm

T
o
p

Re: USB HID Rx/Tx Simulink blockset addon for STM32F4 Target
by srantonio Wed Mar 13, 2013 3:34 pm

RapidSTM32 blcokset needs to be installed (and properly working, but dont worry you not need a Fio board)
to enable USB functionality.
Also before program the F4 target, you need to reset or cycle power on
and reconnect the USB cable to the PC computer.
Also, this addon isnt tested over any Matlab 2012 version.
srantonio

Posts: 169
Joined: Wed Mar 14, 2012 3:45 pm

Re: USB HID Rx/Tx Simulink blockset addon for STM32F4 Target
by JensB Wed Mar 13, 2013 4:37 pm

RapidSTM32 blockset is installed and tested with a FIO Std board. Programming the F4 target works fine.
"Connected via SWD.
Device ID:0x411
Device flash Size : 1024 Kbytes
Device family :STM32F4xx

STM32 ST-LINK CLI v1.3.0


STM32 ST-LINK Command Line Interface
Connected via SWD.
Device ID:0x411
Device flash Size : 1024 Kbytes
Device family :STM32F4xx
Flash Programming:
File : hid_stm32f4_uc3m.bin
Address : 0x08000000
Flash Programming...
Verification...
Flash memory programmed in 1s and 763ms.
Verification...OK
Programming Complete."

T
o
p

But when i start the HID-host i got the error-message i sent befor.
"Error evaluating registered method 'Start' of MATLAB S-Function 'pcusbhid_rx' in 'hid_host/Host HID Receive1'.
The following is the MATLAB call stack (file names and line numbers) that produced this error:
['C:\waijung\Addons\UC3M\pcusbhid_rx.p'] [144]
No valid RapidSTM32 device connected!Make sure that the target is connected and properly configured.Error
Code: 70637573626869645F7278(143)"
When i connect a FIO Std board, the model HID-host starts without any error, but of course there are not any
data.
JensB

Posts: 28
Joined: Tue Apr 10, 2012 6:33 pm

Re: USB HID Rx/Tx Simulink blockset addon for STM32F4 Target
by srantonio Wed Mar 13, 2013 6:32 pm

Sorry, I tested it and works flawlessly.

T
o
p

S-ar putea să vă placă și