CubeMX code generation - microcontroller

I have a cubeMx code generation problem. I generated the whole project with cubeMX but after some modifications I got the following compiler error:
warning: cannot find entry symbol Reset_Handler; defaulting to
08000000
I figured out that the source of the error is first line of my .cproject file.
Before (compiler => OK):
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
After(compiler => error!):
<?xml version="1.0" encoding="UTF-8"?>
Can somebody help me to solve this problem?

Reset_Handler is defined in an assembly language file that is generated by CubeMx:
Drivers/CMSIS/Device/ST/STM32Fxxx/Source/Templates/gcc/startup_stm32fxxx.s
(xxx depending on your board type)
You should make sure this is being built as part of your project.
Hope this helps!

It is still a bug in CubeMX but I found a better more reliable solution to the problem. Navigate to Properties menu / Paths and Symbols / Source Location. Instead of adding the whole project library as a source location with no filter, add every folder one by one (with the add folder button). In this case CubeMX won't fail when generating source locations. My .cpoject file looks like this:
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Common"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Display"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Inc"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Middlewares"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Src"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Tasks"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="font"/>
</sourceEntries>

Meanwhile it turns out that this is a bug in cubeMX version 4.14.0.
There is a walkaround until it is fixed.
SOLUTION
revert the sourceEntries to this in .cproject file
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
See more details here:
Official ST forum
OpenSTM32 forum
UPDATE
Better solution found see above! (accepted answer)
Good luck,
Dave

Related

Why NBug HostApplicationVersion shows an incorrect version of the application?

I get a Crash Report, but HostApplicationVersion does not show the version of my application.
It seems that the version of NBug itself is shown, while the version of my application 2.12.4.0.
<Report xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GeneralInfo>
<CLRVersion>4.0.30319.42000</CLRVersion>
<DateTime>10/14/2020 6:17:46 PM</DateTime>
<ExceptionMessage>Object reference not set to an instance of an object.</ExceptionMessage>
<ExceptionType>System.NullReferenceException</ExceptionType>
<HostApplication>HotBotVPN.exe</HostApplication>
<HostApplicationVersion>1.2.*</HostApplicationVersion>
<NBugVersion>1.2.1.0</NBugVersion>
<TargetSite>...</TargetSite>
</GeneralInfo>
</Report>
You probably need to set this: https://github.com/soygul/NBug/blob/master/NBug/Settings.cs#L391
I'm guessing you are dynamically loading NBug assembly which can cause this.

How can I transform a unity.config file in a nuget package?

I'm trying to transform the contents of a unity.config file at the target of a nuget package. That file looks like this:
<?xml version="1.0"?>
<unity xmlns="http://schemas.microsoft.com/practices/2010/unity">
<container>
<register type="SomeProject.Data.ISecurityManager, SomeProject.Data"
mapTo="SomeProject.MockSecurityManager, SomeProject.Data" />
</container>
</unity>
I want to update the value of "mapTo". I'm updating a bunch of stuff in the web.config with the standard web.config.install.xdt, but the key problem here seems to be that the namespace conflicts between the unity namespace and the transform namespace. So when I create an xdt with the following header for transformation:
<unity xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
Nothing in that file matches, because it's looking in a file with the actual root namespace like so:
<unity xmlns="http://schemas.microsoft.com/practices/2010/unity">
I'm starting to lean towards a Powershell script...can anyone make this approach work?
Just try to add two namespaces for unity node to transform config. It looks like this:
<?xml version="1.0"?>
<unity xmlns="http://schemas.microsoft.com/practices/2010/unity" xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<container>
<register xdt:Transform="Replace"
xdt:Locator="Match(type)"
type="SomeProject.Data.ISecurityManager, SomeProject.Data"
mapTo="It's my test type)">
</register>
</container>
</unity>
It works fine for me. So let me know if it doesn't work for you.

maximo anywhere adding new view not working

I am trying to add a new view in our application. For time being adding this view as the first page in the app. Created necessary OSLC resources in maximo and also verified that I am able to view the data by hitting the URL (ip,userid,pw removed intentionally).
http://{ipaddress}:7001/maximo/oslc/os/ABS_VERI_POINTS?_lid={maximoadminuser}&_lpwd={maximoadminpw}&oslc.select=*
I have also added the view and the resources in app.xml file but when I am logging in to the application it gives me the following message
"WorkList Record Could Not be Downloaded. If Problem persists, Contact your administrator"
After than it landed up into the view with No data. Upon inspecting the UI in browser I noticed I am getting the following error
Procedure invocation error. Runtime: Failed to parse JSON string
Error 404--Not Found
....
....
Resource Data in app.xml is as follows
<resource describedBy="http://jazz.net/ns/ism/asset/smarter_physical_infrastructure#ABS_VERI_POINTS" id="resabsVP" name="resabsVP" providedBy="/oslc/sp/SmarterPhysicalInfrastructure">
<attributes id="absVPAttrs">
<attribute describedByProperty="spi:parent" id="vpparent" name="parent"/>
<attribute describedByProperty="spi:location" id="vplocation" name="location"/>
<attribute describedByProperty="spi:assetnum" id="vpassetnum" name="assetnum"/>
<!-- attribute describedByProperty="spi:abs_verification_pointsid" id="vpabsvpid" name="absvppointsid" -->
<attribute describedByProperty="spi:taskid" id="vptaskid" name="taskid"/>
<attribute describedByProperty="spi:description" id="vpdescription" name="description"/>
<attribute describedByProperty="spi:wonum" id="vpwonum" name="wonum"/>
</attributes>
<queryBases id="absvpqry">
<queryBase id="absvpqry1" name="getabsvp" queryUri="oslc/os/ABS_VERI_POINTS" />
</queryBases>
</resource>
View in app.xml as follows
<view id="absVPview" label="ABS Verification Points">
<requiredResources id="absVPAttrs11">
<requiredResource name="resabsVP" id="resabsVP11">
<requiredAttribute id="vpdescription1" name="description"/>
<requiredAttribute id="vpwonum1" name="wonum"/>
<requiredAttribute id="vpparent1" name="parent"/>
</requiredResource>
</requiredResources>
<list id="VP.abs_veri_points_list" resource="resabsVP" >
<listItemTemplate id="VP.abs_veri_points_list_listItemTemplate" layout="InspectionListItem">
<listtext id="VP.abs_veri_points_list_vpid" resourceAttribute="description" layoutInsertAt="item1"/>
<listtext id="VP.abs_veri_points_list_wonum" resourceAttribute="wonum" layoutInsertAt="item2"/>
<listtext id="VP.abs_veri_points_list_parenttext" resourceAttribute="parent" layoutInsertAt="item3"/>
</listItemTemplate>
</list>
</view>
Can you please give any clue whats going wrong here
Can you open a PMR on this with our support? This may be a bug where we're not correctly handling underscores in our OSLC request url to retrieve data. Also, check the URL that is failing in your javascript console, just to make sure that it's really this resource throwing the 404 exception. You might check the network tab of the debugger to see that.
#MDutta,
If the issue is in the object/attribute using underscore ("_"), you can fix this by updating the xsd validation file located at ..\Anywhere\lib\codegen\artifac-processor-7.5.2.jar.
Unzip this file and open the app.xsd located: ..\resource\xsd\app.xsd. Modify the validation
From:
<xs:simpleType name="string">
<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z][a-zA-Z0-9]+"/>
</xs:restriction>
</xs:simpleType>
To:
~dk

Translations of QMessageBox not work in Qt5.3

I'm a fan of Qt and update it frequently, Qt5.1->5.2->5.3.
However, the tranalations of Standard buttons like "Ok" "Cancel" "Save" do not work anymore in Qt5.3.
They are not translated, but just plain English.
The Code for translations does NOT change through each version of Qt.
like:
TRANSLATIONS = qt_fr.ts
QTranslator trans
trans.load("qt_fr");
a.installTranslator(&trans);
any idea?
[Update]
AFAIN, it might be a bug. Go back to Qt5.1 is a slution if U dont have to use some improvements in new Qts.
Starting from Qt5.3 the qt_*.qm is divided into multiple files (qt*_*.qm) and now you have to copy qtbase_*.qm to translation directory and use together.
QString translationsPath(QLibraryInfo::location(QLibraryInfo::TranslationsPath));
QLocale locale = QLocale::system();
QTranslator qtTranslator;
if (qtTranslator.load(locale, "qt", "_", translationsPath))
a.installTranslator(&qtTranslator);
QTranslator qtBaseTranslator;
if (qtBaseTranslator.load(locale, "qtbase", "_", translationsPath))
a.installTranslator(&qtBaseTranslator);
I had the same problem and got it to work with an updated translation file. I am not sure if this is the intended behaviour, but my qt_de.qm has a filesize of only 1kB. There is however a file called qtbase_de.qm now (154kB) which seems to do the trick.
This is source of qt_ru:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="ru">
<dependencies>
<dependency catalog="qtbase_ru"/>
<dependency catalog="qtscript_ru"/>
<dependency catalog="qtquick1_ru"/>
<dependency catalog="qtmultimedia_ru"/>
<dependency catalog="qtxmlpatterns_ru"/>
</dependencies>
</TS>
Therefore, it is necessary to deploy application with all these translation files. If at least one file is missing, the translation qt_ru will not load.

Group testNG tests without annotations

I'm responsible for allowing unit tests for one of ETL components.I want to acomplish this using testNG with generic java test class and number of test definitions in testng.xmlpassing various parameters to the class.Oracle and ETL guys should be able to add new tests without changing the java code, so we need to use xml suite file instead of annotations.
Question
Is there a way to group tests in testng.xml?(similarly to how it is done with annotations)
I mean something like
<group name="first_group">
<test>
<class ...>
<parameter ...>
</test>
</group>
<group name="second_group">
<test>
<class ...>
<parameter ...>
</test>
</group>
I've checked the testng.dtd as figured out that similar syntax is not allowed.But is therea workaround to allow grouping?
Thanks in advance
You can specify groups within testng.xml and then run testng using -groups
<test name="Regression1">
<groups>
<run>
<exclude name="brokenTests" />
<include name="checkinTests" />
</run>
</groups>
....
No, this is not possible at the moment.
As a rule of thumb, I don't like adding information in XML that points into Java code, because refactorings might silently break your entire build.
For example, if you rename a method or a class name, your tests might start mysteriously breaking until you remember you need to update your XML as well.
Feel free to bring this up on the testng-users mailing-list and we can see if there's interest for such a feature.
--
Cedric

Resources