LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

labview for stm32f103 development board?

hi,

 

good evening, i'm a student who's currently working on a thesis that involves the stm32f103 development board. our board uses a 32-Bit ARM Cortex-M3 Processor with a 128KB flash memory. it also has RS232 and USB ports for direct connection to the computer. i was just wondering if there are any labview products that are compatible with our board?

0 Kudos
Message 1 of 39
(15,598 Views)

Hi mat2_chan2,

 

You have a few options depending on what you mean by "compatible with our board."  There are 2 options I see:

1) You can use LabVIEW to communicate with your evaluation board (through RS232 or USB).  If you've already got your code working as you wish on the evaluation board, this would be the option for you.

2) You can use LabVIEW and the LabVIEW for ARM module to download actual LabVIEW code to the board itself.  I tried to identify whether or not your chipset would be supported, but you didn't specify enough information.  You can look here: RL-ARM Real-Time Library.  (Chips for which the RL-ARM Real-Time Library exists can support LabVIEW code.)  More information can be found at www.ni.com/arm.  This method would require background work in order to port LabVIEW to your chip - integrating all of the chip's functionality into the LabVIEW environment.  (If you're really tight on time, you need to take this into account.)  See this link: Programming Additional ARM Microcontrollers with LabVIEW (without the LabVIEW Microprocessor SDK)

 

I hope this helps,

Kevin S.

Applications Engineer

National Instruments

Message 2 of 39
(15,572 Views)

good evening,

 

thank you very much mr. Kevin_S, that really cleared some things for us. we have already ordered the board but still hasn't arrived yet, so we're not very sure about the chip. based from our research, we think it uses the stm32e103RB microcontroller.

 

we'll be posting again soon and we appreciate your help. thanks.

 

mat2_chan2

0 Kudos
Message 3 of 39
(15,548 Views)
Where can i get the necessary paths, #defines, and libraries for the TargetConfig.ini file and the template files that are both needed for the target folder for STM32F103RB? By the way, I dont have LabVIEW Microprocessor SDK
Message Edited by aeolia on 03-08-2010 03:29 AM
Message Edited by aeolia on 03-08-2010 03:33 AM
0 Kudos
Message 4 of 39
(15,104 Views)
Hi Aeolia,

Are you planning on using LabVIEW Microprocessor SDK, or are you using another National Instruments product? Are you going through the port guide? If so, what version? Can you post a link please?
Joshua B.
National Instruments
0 Kudos
Message 5 of 39
(15,064 Views)
I'm not planning to use LabVIEW Microprocessor SDK. I will only use Labview 8.6 and Labview Embedded Module for ARM Microcontrollers v1.1. I'm currently followng this guide: http://zone.ni.com/devzone/cda/tut/p/id/7152 to create a target folder for STM32F103RB. I'm stuck on the part wherein I will add any necessary paths, #defines, and libraries for any additional drivers for the TargetConfig.ini file and I also don't know where to get the µVision template files of STM32F103RB. Can you please help me? Thanks.
0 Kudos
Message 6 of 39
(15,058 Views)
Thanks for your reply, this clarifies a lot. When you download libraries that define IO pin mappings and register locations you should add the paths to those files into the TargetConfig.ini. That way, when building the compiler and LabVIEW knows where to find the correct header files, etc. It appears that you can get some libraries from ST website for the STM32F103RB. LabVIEW for ARM contains many of the files and defines that you may need,  but you may have extra for will need to change so that you have the right mappings.

The template file should be in the folder that you copied. For example, you copied the LPC2378 folder and renamed to STM32F103RB. You would then need to go into that folder and open the Template folder and modify per step 10 of the link you had sent me.

Joshua B.
National Instruments
0 Kudos
Message 7 of 39
(15,010 Views)

Hello

 

I'm also trying to port labVIEW on a STM32F103RB. I followed our tutorial on the LCP3180 to create the template folder.

I succeed to debug the errors to build the project.

I succeed to download my code to the flash memory. I do a while loop with an indicator on the index loop and a wait function of 100ms in the loop.

 

But I have an error on the "Processor Status" : Stopped at 0x08002C9E

This address change if I modify the labVIEW Code.

 

I join a capture screen of my error.

 

What is the action which is done during this stage ? Do you have an idea of the cause of this error.

 

Thanks, best regards. 

 

 

M.SPISSER 

Student in the Engineer School of St Etienne

 

 

0 Kudos
Message 8 of 39
(14,981 Views)
Howdy,

Is

Let's try a couple of debugging steps:

0. What version of LabVIEW are you using? (Help»About LabVIEW)
1. Can you run non-LabVIEW generated code, like a basic C program that blinks an LED?
2. What optimizations, if any, do you have turned on?
3. Do you have a wait inside your while loop?
4. Can you open Keil and show the call stack window.

arm-ss.jpg

5. Did you follow the porting process of the RT Agent?
Joshua B.
National Instruments
0 Kudos
Message 9 of 39
(14,937 Views)

Hi ARM keiller

 

 Can you please upload here the whole STM32F103RB target folder that you are using so that I can compare mine with yours? You can just make the whole folder a rar file so that uploading will be much easier. Thanks

0 Kudos
Message 10 of 39
(14,925 Views)

Thanks for your answer

 

I saw that my program stopped on a breakpoint due to "semihosting_swi" so I modified my "retarget.c" file. And my program ran !!!

 

 

Now I'm trying to include the library of STM32_functions supplied by keil's libraries with LabVIEW. In order to use this function to 

configure my GPIO... But I don't succed !!! Because Inline C nodes are not enough powerful to make this.

 

 

And when I open uVision in debug mode I notice that my HCLK run at 8Mhz and not 72Mhz.... Is it normal ? I thought that RTX configure

 

automatically the clock at 72 Mhz ...???

 

Thanks for your answer.

 

0 Kudos
Message 11 of 39
(7,839 Views)

Hi aeolia

 

 

Why do you need to port LabVIEW on a STM32F103 ? Can you specify your application ?

 

Give me your email address and I will be able to give you my folder.rar .

 

I'm trying to configure my GPIO, but I haven't yet succedded. I hope that you will be able to help me later.

 

Best regards.

0 Kudos
Message 12 of 39
(7,840 Views)
Hello and you're welcome,

What do you mean that you did not succeed when trying to include the libraries? Did you get an error? Can you describe the process you are going through in more detail please? Perhaps you can help the community out and post what you have so far so that we all can see?

I am unsure about the clock issue, I will look more into that.
Joshua B.
National Instruments
0 Kudos
Message 13 of 39
(7,810 Views)

Hello DiscoBall

 

 

I succedded to use my lybrary of function because I found how the files.c and .lib can be attached to the project when this latter is building.

 

 

I identified my problem : when you create a new ARM project with  EK-LM3S8962 or MCB2300 or MCB2400 and that you right-click on your target on "new" , you can select "Elemental I/O".

But if you create a project with a Philips NXP LPC2378, LPC2468 or with the luminary micro device and that you click on the name of your target in the Project Explorer on "new" you CAN'T create new "Elemental I/O" because there is NOT "Elemental I/O".

 

 

I modified my VI to configure my GPIO and I created my ressources and pins with the "Elemental I/O Device Wizard to create the eio.xml.

 

But I can't do anything because of the "Elemental I/O" doesn't exist.

 

Please have you an answer for my problem. Thank you.

 

Best Regards

0 Kudos
Message 14 of 39
(7,803 Views)
Hi,

What path do you have your eio.xml file in? Does the eio.xml specify the correct path to the VIs in the file? Did you change the name from "Other" in the project to the correct device?
Joshua B.
National Instruments
0 Kudos
Message 15 of 39
(7,776 Views)

Hi ARM keiller 

 

Our ARM microcontroller will basically control the movement of the motors, gather data from the sensors and sends it to the PC wirelessly via zigbee. We already have the labview codes for all of this. We only just need the STM32F103RB target folder.

 

  Here's my email address: beniong@yahoo.com 

 

Thanks 

0 Kudos
Message 16 of 39
(7,770 Views)
Hi ARM keiller



 I knew how to drive GPIO/ADC/LCD and so on in labview ARM module by inline C CODE.Tell me your Email ,I will give it to you .I also ported STM32 in labview , it seems successed , but if I use inline C code in it ,it can not work.so can you send your STM32F103RB target folder to me ,and I send mine to you .



  Here's my email address: beniong@163.com 



Thanks
0 Kudos
Message 17 of 39
(7,738 Views)

Hi !

 

 

Thanks for your answer. I succeeded to configure my GPIO. 

I'm trying to modify the C source code which manage the different interrupt. I have an error which causes an Hard Fault interrupt .

 

How would you do to detect the source of this error ???

When I use µvision I can't go step by step because I'm stopped by this line : while(OCDI_RDMStart != 0x01);

 And I don't succeed to activate thiscondition from LabVIEW.

 

And if I use breakpoint on LabVIEW code I have an unknown exception....

 

 

If you have a great idea about this thanks to share it with me.

 

 

best regards 

0 Kudos
Message 18 of 39
(7,670 Views)

Hi Arm keller,

 

Can you post screenshots of your error and post your code. What did you modify?

Joshua B.
National Instruments
0 Kudos
Message 19 of 39
(7,646 Views)

For everybody who want to port LabVIEW on a CORTEX M3 and use an interrupt . Please read this :

 

RTX Library version for Cortex™-M devices allows to select the running mode of all user tasks. User tasks may run in two modes:

  • Unprivileged - Protected mode or
  • Privileged - Unprotected mode.

In privileged mode user may access and configure the system and control registers like NVIC interrupt controller etc. This is however not allowed from unprivileged mode. An access to NVIC registers from unprivileged mode will result in Hard Fault.

 

 #define OS_RUNPRIV 1

 

  • OS_RUNPRIV enables running of all tasks in Privileged mode. It must be set to 1 to enable it or 0 to disable it. It is disabled by default.

    You can enable the privileged mode for old projects. The existing code will run without any modifications when RTX_Config.c configuration file is replaced with a new one and a project is recompiled for a new Cortex™-M RTX Kernel library. Tasks are not protected in privileged mode and you may configure the system for example the interrupts from any task.

    Privileged mode is disabled by default. This allows all tasks to run in protected mode. The tasks are not allowed to change system settings, change interrupts etc.

 

Message 20 of 39
(7,620 Views)

hi,

 

good afternoon. it's been a while since i visited this thread. i was wondering if anybody can help me create the target folder for our STM32F103RB board. i'm currently stuck in the Programming Additional ARM Microcontrollers (without SDK) with LABVIEW part of the turorial. we copied the LPC2378 folder in the Generic folder and renamed it as STM32F103RB. we don't know what the necessary #defines, paths and libraries are, and we don't know how to update the files in the folder.

 

we need to fix the target folder before we can use our ULINK JTAG adapter to our board. can anybody please help us?

 

thank you very much for your cooperation. 

0 Kudos
Message 21 of 39
(6,586 Views)

Howdy,

 

It looks like you are in the same position as aeolia was a little while ago. Can you please tell me what version of the Porting Guide you are using (link please). I believe message 7 of this forum answers your questions. Do this help?

 

 

Joshua B.
National Instruments
0 Kudos
Message 22 of 39
(6,562 Views)

hi,

 

i'm currently following the instructions in this link http://zone.ni.com/devzone/cda/tut/p/id/7152 i downloaded all the files in the firmware section from http://www.st.com/mcu/devicedocs-STM32F103RB-110.html but i'm confused if i'm supposed to copy every single header file into the template\include folder. i also don't know how i'm going to integrate the standard peripheral library folder into the  template\drivers folder.

 

i'm not used to modifying files so i'm afraid i might accidentally delete some crucial parts of the target folder. i would appreciate any help with this problem.

 

thanks 

0 Kudos
Message 23 of 39
(6,547 Views)

hi, regarding my problem earlier with the target folder, is there anybody who can accept my target folder and fix it? i really need help with the interfacing because we are also using labview to program our STM32F103RB development board. our thesis basically needs to use labview to drive motors based from input sensors. we also bought a ULINK JTAG adapter because we thought it would help us with the interfacing.

 

thanks, 

mat2_chan2 

0 Kudos
Message 24 of 39
(6,539 Views)
Hi,

Here is how I would modify the default TargetConfig.ini...

[INCLUDE_PATH]
add the path to the folder that contains the .h files for folder that you download from STM (usually inc folder)

[INCLUDES]
add the names of the files that you are needing, if you need the ADC then it is probably prudent to add the stm32f10x_adc.h in this list, etc.

[FILE]
this are the links to C files that are use, usually found in the src folder (for example stm32f10x_adc.c)

Don't be afraid to try and make some mistakes, if you can always start again, you shouldn't be able to make irreversible damage

Joshua B.
National Instruments
0 Kudos
Message 25 of 39
(6,524 Views)

Hi DiscoBall,

 

thanks for helping me modify the TargetConfig.ini file. when i run the labview program, i can now select the STM32F103RB folder.

 

how do i test if the target folder's working properly to interface with our board?

 

thank you very much.

0 Kudos
Message 26 of 39
(6,510 Views)
Are you unable to make a simple VI and attempt a deployment? Do you not have the hardware yet?
Joshua B.
National Instruments
0 Kudos
Message 27 of 39
(6,481 Views)
we're working on it. we're currently stumped how to assign the gpio ports of the board using labview. we are new to the labview environment and we do not know how to program our C-Language algorithms with it. we tried following the basic tutorial in programming but didn't help us much in porting our board. we are open to suggestions to help us interface the labview program and our board. thanks.
0 Kudos
Message 28 of 39
(6,471 Views)
Hi,

If you are dealing with GPIO, you will need to use the GPIO wizard and will need to have some C code that you can call into. What exact issues are you having with the GPIO, are you encounter errors? Can you be more specific? What is the goal of your application? What are you needing to accomplish with the STM and LabVIEW?
Joshua B.
National Instruments
0 Kudos
Message 29 of 39
(6,454 Views)

Hi,

 

Did you ever manage to port this processor into LV, I have the same problem and was hoping someone could guide me. I have tried following the porting guide but get totally confused with the where to Obtain certain files... Please Help!!

 

Thanks

0 Kudos
Message 30 of 39
(5,764 Views)

Hi everyone,

 

This is where I'm at. I have been following the instructions in this link http://zone.ni.com/devzone/cda/tut/p/id/7152 . I have managed to get to the stage of modifying the TargetConfig.ini with the the files obtained from ST Microelectronics. Basically I have completed message 25 from Joshua of this forum.

 

At this stage I can select my STM32F103 processor from within in LV and build a simple project, however I get build  fail with errors. As below, there are a lot more similar but have only included the first.

 

C:\Program Files (x86)\National Instruments\LabVIEW 8.6\Targets\Keil\Embedded\RealView\Generic\STM32F103\Include\stm32f10x.h(80): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
compiling stm32f10x_usart.c...

 

I'm not sure where to go from here, do I need to continue with the RTX_Config.c & Retarget.c files? It's just I can't seam to get my head around this part & don't really know where to obtain these files..

 

Could someone point me in the right direction? Or does someone have a target folder with this STM32F103 files.

 

My setup is

 

LV 8.6

Arm 1.1

Not using micro SDK

 

 

Thanks everybody.

0 Kudos
Message 31 of 39
(12,434 Views)

Hi Ollie,

 

Not quite a zombie forum thread yet...:)

 

Starting at line 47 of the stm32f10x.h file there are a couple of entries with the note, "Uncomment the line below according to the target STM32 device used in your application" Did you uncomment any of these lines or did you leave the default in there? Can you post your TargetConfig.ini file?

 

Please note that my responses may be slow during this week because of the holidays.

Joshua B.
National Instruments
0 Kudos
Message 32 of 39
(12,405 Views)

Hi Joshua,

 

Thank you for your reply, I had not uncomment the the line in stm32f10x.h, it was left at default. I'm assuming I have to uncomment one of the options so I will give it a try and see what happens.

 

What about the RTX_config.c and retarget.c?

 

I have attached my TargetConfig.ini for your inspection.

 

 

Thank you very much and most appreciated.

 

 

0 Kudos
Message 33 of 39
(12,395 Views)

Hi Joshua,

 

I have an update. I released that I missed some important files out so I have attached an amended TargetConfig.ini. I am reducing the errors but currently stuck with this one:-

 

Build target 'LabVIEW'
compiling RTX_Config.c...
C:\Program Files (x86)\National Instruments\LabVIEW 8.6\Targets\Keil\Embedded\RealView\Generic\STM32F103\Libraries\CoreSupport\core_cm3.h(1502): error:  #20: identifier "IRQn_Type" is undefined
C:\Program Files (x86)\National Instruments\LabVIEW 8.6\Targets\Keil\Embedded\RealView\Generic\STM32F103\Libraries\CoreSupport\core_cm3.h(1515): error:  #20: identifier "IRQn_Type" is undefined.

 

Again there are a lot of them but all similar referring to core_cm3.h.

 

Thanks Again

0 Kudos
Message 34 of 39
(12,392 Views)

Hi Ollie,

 

I am not sure what is going on at the moment, but does the core_cm3.h file have a definition for IRQn_Type function? I don't really have a good troubleshooting step for you at the moment. The core_cm3 should have that already defined: http://www.keil.com/support/man/docs/gsac/gsac_nvic.htm

Joshua B.
National Instruments
0 Kudos
Message 35 of 39
(12,372 Views)

Hi Joshua,

 

Thanks for the reply, I think I may have resolved the issue with the compiling error, however during the linking process I have the following errors:-

 

compiling RLARM_LVNetworkVarSupport.c...
compiling RLARM_CAN_Wrapper.c...

linking...
.\Obj\LabVIEW.axf: Error: L6218E: Undefined symbol ARM_rtc_gettime (referred from ccgtimesupport_rtx.o).
.\Obj\LabVIEW.axf: Error: L6218E: Undefined symbol ARM_Serial_AvailChar (referred from platformserial_rtx.o).
.\Obj\LabVIEW.axf: Error: L6218E: Undefined symbol ARM_Serial_ClosePort (referred from platformserial_rtx.o).
.\Obj\LabVIEW.axf: Error: L6218E: Undefined symbol ARM_Serial_InitPort (referred from platformserial_rtx.o).
.\Obj\LabVIEW.axf: Error: L6218E: Undefined symbol ARM_Serial_OpenPort (referred from platformserial_rtx.o).
.\Obj\LabVIEW.axf: Error: L6218E: Undefined symbol ARM_Serial_Read (referred from platformserial_rtx.o).
.\Obj\LabVIEW.axf: Error: L6218E: Undefined symbol ARM_Serial_Write (referred from platformserial_rtx.o).
.\Obj\LabVIEW.axf: Error: L6218E: Undefined symbol ARM_init_rtc (referred from armclib_rtx.o).
.\Obj\LabVIEW.axf: Error: L6218E: Undefined symbol ARM_TargetInit (referred from lvinit_rtx.o).
.\Obj\LabVIEW.axf: Error: L6218E: Undefined symbol ARM_TargetUnInit (referred from lvinit_rtx.o).
Target not created

 

I have been trying to resolve this issue but am at a loss as to whats causing it, I think i'm missing something, have you any pointers?

 

Happy Christmas Smiley Happy

 

I have also attached my new targetConfig.ini file

0 Kudos
Message 36 of 39
(12,367 Views)

HI Ollie,

 

I'll chat with our embedded development team to see what is going on.

Joshua B.
National Instruments
0 Kudos
Message 37 of 39
(12,300 Views)

Hi Ollie,

 

Looks like we have a port for the STM chip already. I have attached the UVision project. I would put this in your Generic folder and give it a shot. Let me know if you run into any trouble! It looks like the errors you are getting are because the ARM_RTClock.c and ARM_Serial.c are not in your project. In the project I have attach they should already be included and help you get passed those build errors.

 

 

Joshua B.
National Instruments
0 Kudos
Message 38 of 39
(12,266 Views)

Hi Joshua,

 

Thank you for your help, the new porting files worked a treat, however I had to find the tim1 h & c files from the net as my Keil did not have them.

However I have noticed once the compiler has finished the uvision has the STM32F103ZET6 chip selected, which is the high density chip.

I have the medium density chip "STM32F103RBT6". If I select this chip under devices it reports the programming was successful to the target, if I rebuild the project again I get the following error:-

 

compiling stm32f10x_lib.c...
linking...
.\Obj\LabVIEW.axf: Error: L6406W: No space in execution regions with .ANY selector matching Section HEAP(stm32f10x.o).
.\Obj\LabVIEW.axf: Error: L6407W: Sections of aggregate size 0x8000 bytes could not fit into .ANY selector(s).
Target not created

 

I have to reselect the STM32F103ZE (not the ZET6 as I can't find the original) under devices and re build for every thing to be OK, then reselect the RB version to program.. I'm I doing the correct thing here or is there a better way?

 

Also I only have the STM-H103 header board, it has one led connected to PC12 (pin53). What will I have to do to select this under the Elemental IO as PC12 is not listed, I have read chapter 3 but as a little confused, any advise would be welcome

 

My thoughts are at least do something with this LED to prove that the  programming of the device is working..

 

Thanks again for your help.

 

Regards

 

Ollie

 

 

0 Kudos
Message 39 of 39
(12,244 Views)