Adding the I-CUBE-LRWAN library to a STM32CubeMX project - embedded

My team and I are currently working on a project that involve a ST board (the STM32L072CZYxx) to create a bidirectionnal GSM-LoRa gateway.
As we've already succeeded in implementing the GSM side of the gateway, we are currently working on the LoRa part of the project. To achieve this, we're trying to use the I-CUBE-LRWAN, but can't figure out how to add this library to the STM32CubeMX project. It seems like, this library can't be added to our project through STM32CubeMX. The only solution we have is to add manually the library to the project but we can't figure out how to do it. We imported the middlewares we needed into the project however, the IDE we use (Atollic TRUEStudio or SW4STM32) detects a lot of errors in the project and we really don't understand why (the source for middlewares were coded by ST, so basically no errors).

I'm guessing that is Murata LoRa Module. First time I tried that I was not able to add library to existing project.
There is some error that occur because of length of path names -on windows- you can copy and paste the project to shorten the path name and then i was able to program the module to use it as AT command slave.
And also there is 3 target project on that project file you need to select the proper target for it.

Related

CI build failed in case project reference is from another .net solution

I have two independent .net projects. One is like a project which is baiscalliy to process invoice and another project is something which I am calling as common as I am keeping all sharable/reusable code under that.
Now any project can consume this common-project by adding it via add Existing project option so that source code will not move to consumer project which is Invoice management in my case.
Now if I add common project as reference and run my CI pipeline its failed as its not able to find the path of common project which is obvious as it may be different from my local machine to build server.
Now the solution that I am aware of are below :
Make common as Nuget package and use it under invoice management.
Build common project dll at some centralized file server and give that path in Invoice management
for reference instead of absolute path.
Both solutions are not simple to implement so I am looking for any better quick solution for the situation where project setup is like this and CI build has to execute.
The best would be actually reference via NuGet package. However, there is a third option which I do not recommend. You can use multiple repository pipeline. You will checkout there two repositories. In thi case you have to mimic folder structure wich you will get on AzureDevops. Otherwise build will fail as it will not find the references.

Extending Titanium WebViewProxy for Android - Build error

I need to extend Titanium's Android Webview with some additional functionality, however I'm not able to build my titanium project after including my created module.
My module has the titanium-ui.jar on it's build path and I have copied the original Titanium WebViewProxy.java into my module project. I haven't added any custom code to WebViewProxy.java yet.
This is the project hierarchy of my module, together with the build.properties file.
When building the module, I get an exception but the module seems to get built anyway, this must have something to do with the final problem. When I remove the WebViewProxy.java and keep the titanium-ui.jar on my build path, building the module and including it in my titanium project works fine.
Here's the full console log of the build script of the module: http://pastebin.com/G2LSkFLF
This is what happens when I try to run my titanium project using the generated module (the one, that threw the exception while building)
Does anyone know how to solve this? Maybe some different approach at all? I have some special url schemes in my app and I need to handle them. I have already a similar module for iOS, which works fine.
Thanks.
Ok, I finally found the solution. It was so easy... The WebViewProxy.java had to be adjusted a little bit.
#Kroll.proxy(creatableInModule=UIModule.class, propertyAccessors = {
has to be
#Kroll.proxy(creatableInModule=CustomwebviewModule.class, propertyAccessors = {
UIModule.class has to be replaced with the class name of your Module.

Xcode 4 adding dylib

I am trying to create and then add the dylib to a project.
I created it by using the "Cocoa-Library" template and setting the type to "Dynamic" (not sure if it should be dynamic or static...). Then I created a simple obj-c class called Test and wrote a method in it that prints out something to console.
I compiled and used the generated .dylib file and put it in another project. Now whenever I try to use it, I get this message on runtime"
dyld: Library not loaded: /usr/local/lib/TESTLib.dylib
Referenced from: /Users/***/Library/Developer/Xcode/DerivedData/TestingDYLIB-axmoocnxbwznoyerfogosumqufxc/Build/Products/Debug/TestingDYLIB.app/Contents/MacOS/TestingDYLIB
Reason: image not found
I also created a Copy File phase and set the destination to "Frameworks". I still get the same error.
What am I doing wrong?
The issue is not where Xcode is looking for the library at compile time, which is what Simon Whitaker's answer addresses.
The issue is that the application which uses the dylib cannot find it at runtime. When an application is built that uses a dynamic library, it copies the install_name of the dylib into the output binary.
Creating a copy files phase and copying the dylib to the Frameworks subdirectory of the app's bundle is the right thing do do.
However, you need to do an additional step. You need to compile the dynamic library with an install_name appropriate for a bundle app. By default, a dynamic library is created with an install_name of /usr/local/lib. The app can't find your library there because it doesn't exist. Even if you put the library there, your users certainly won't have it, so that would be the wrong solution.
The right solution is bundling the library with the app. To set the install name for the dynamic library, go into the dynamic library project and set the "Dynamic Library Install Name" option to: #executable_path/../Frameworks/libmydynamiclibrary.dylib
Xcode is looking in /usr/local/lib/ for the library. If the library is in another location, add that location to your Library Search Paths:
Select project file in Xcode 4
Select the target, then click the Build Settings tab
Make sure All is selected in the filter bar (not Basic)
Scroll down to the Search Paths section and you'll find Library Search Paths in there

MSBuild overwriting dependencies

Ok, so I've got a somewhat complicated problem with my build environment that I'm trying to deal with.
I have a solution file that contains multiple C# projects which is built by a NAnt script calling MSBuild - passing MSBuild the name of the solution file and a path to copy the binaries to. This is because I want my automated build environment (CruiseControl.Net) to create a folder named after the revision of each build - this way I can easily go back to previous binaries for any reason.
So idealy I have a folder layout like this
c:\build\nightly\rev1
c:\build\nightly\rev2
c:\build\nightly\rev3
...
c:\build\nightly\rev10
etc.
The problem that's arisen is I recently added the latest version of the Unity IoC container to my project, checking it directly out of MS's online SVN repository. What's happening is I have a Silverlight 3 project that references the Silverlight version of Unity but I also have other projects (namely my Unit testing project) that reference the standard (non-Silverlight) version of Unity.
So what happens is since MSBuild is dumping everything into one single folder the Silverlight version of the Unity assembly is overwriting the non-Silverlight version because they have the exact same assembly file name.
Then when CruistControl runs my unit tests they fail because they don't have the proper dependencies available anymore (they try to load the Silverlight specific Unity assembly which obviously doesn't work).
So what I want to do is:
keep my desired output directory
structure (folder\revision)
I don't want to have to manually edit
every single proj file I have as this
is error prone when adding new
projects to the solution
Idealy I would like MSBuild to put everything into a folder structure similar to this:
nightly\revision1\project1
nightly\revision1\project2
nightly\revision1\project3
...
nightly\revision2\project1
nightly\revision2\project2
nightly\revision2\project3
etc
I can't modify the Unity project to give it a different file name because it comes from another SVN repository I cannot commit changes to. I found a similar question posted here and the suggested solution was to use a "master" MSBuild file that used a custom task to extract all the project file names out of the solution then loop over each one building them. I tried that but it doesn't build them in the order of their dependencies, so it fails for my project.
Help?
Firstly I would always have the build server delete the old working copy and check out a fresh copy to avoid any problems with stale artifacts from the previous build.
Next I would have nant or msbuild build the solutions as before with the artifacts from each build going to their local working output folders.
After that I'd move the artifacts from their working paths to their output paths, this shouldn't require digging through the project files since you can just tell msbuild/nant to copy working\project1\bin\release\**\*.* to artifacts\project1\.
The script that does this should ideally be stored along with the source with the main file, e.g. build.nant or build.proj in top level of the trunk.
For third party libraries I would simple include the DLLs directory in your repository. Nothing worse than writing some code and having a third party dependency break your build because of changes on their end.
Simply document the versions of the libraries you are using, and if you must update them, you'll have a better sense of what breaks the build before you even check it in.
Also, doesn't CC.Net automatically handle the providing of releases based on revision? I'm using TeamCity and it keeps a copy of the artifacts of every build.
I highly recommend reading JP Boodhoo's Automating Builds with NAnt blog series. That's been my starting point and have made lots of changes for my own taste. I also highly recommend checking out the builds of many open sources projects for examples. I've learned a lot from the builds of the Castle/Nhibernate/Rhino-Tools stack.

How do I use a dynamically load library in a command line utility? [duplicate]

This question already has answers here:
Closed 13 years ago.
Possible Duplicate:
using frameworks in a command line tool
Hey,
I've written a command line 'foundation tool' that uses the RegexKit.framework extensively. Everything works when run in Xcode but if I compile the release build and try to run it in Terminal I get the following error:
dyld: Library not loaded: #executable_path/../Frameworks/RegexKit.framework/Versions/A/RegexKit
Closer inspection reveals that the RegexKit.framework bundle is sat in the same directory as my executable file... I've done some research and I'm thinking that as command line tools don't use application bundles there's no where for Xcode to copy the framework to. So I'm guessing that I need to compile the framework as a static library and include it in my code... am I right? If so, how do I go about doing this? Is there anything I can do in Terminal to point to the framework externally?
Any help would be very greatly received, I've been banging my head against this for a few days now!
Thanks in advance,
Tom
So... What I did in the end was to recompile the framework with a different Installation Directory (in the Deployment section, under the Build tab in the Target's Info) - I set it to just #executable_path.
I then compiled the framework and replaced the one in my Utilitie's project, I also changed the Copy Files build phase to copy the framework to "Executables" rather than Frameworks.
The good news is that this fixes my original problem - but obviously the framework has to be in the same directory as the executable.
So this got me unstuck but I'd still love to know how to compile RegexKit.framework statically!
You shouldn't be installing the framework in the Executable folder of your bundle. It should be in the Frameworks folder. You need a Copy Files phase in your project that copies the framework and you need to set the Destination to "Frameworks". "Copy only when installing" should be unchecked.
When testing this, you should make sure you perform a clean build. I typically delete the build folder rather than using Xcode's Clean menu option since it's quicker and more comprehensive.
Also: you cannot statically link to a framework. If you want to statically link to something, it needs to be a static library so in this case, you'd need to hack about with RegexKit. Bear in mind that static libraries cannot contain resources, whereas Frameworks, being bundles, can.