How to get FATfs working on Xmega A4? Not sure what I should add or what file to edit - sd-card

First of all, I have already been through http://elm-chan.org, and while it has helped me, it is a bit vague (in my opinion).
I am attempting to read an SD Card with an Xmega128a4u using ASF (because the non-ASF way is too underground for me...). Anyway, although ASF has an example with the Xplained board for Xmega C3, it is not very helpful, and my attempts at porting it fail.
So, the following is what I do:
I start a Project in ASF (I'm programming in C)
I add the FATfs, SD/MMC and systemClock divers(or modules or services) to my project through ASF Wizard.
I get kind of lost... :(
I read in elm-chan's page that some sort of "glue file" but it's not very specific in what it should be. What should I #include in it or where should I #include it?
I'd appreciate some help on this as I have tried several things with no success.

you have to addapt the disk_read, disk_write, ... functions in the diskio.c file. they will connect the fatFS library with your (low-level) sd communication.
you should may first test a simple communication with the sd-card without file system.
I have the same "project" but with an arduino due board instead of Xmega and the simple communication does allready work, so I can read and write. But my problem is to addapt the FatFS correctly and I suppose that the fault can be localized in my diskio.c functions, cause they are individual.
Maybe someone has got the same problem and can help me?
Ciao
Imke

Related

building android source for pixel 6

I'm trying to build grapheneos for pixel 6 with custom bootanimation.
I created the bootanimation.zip file according to instructions but can't figure out the location to put it in. Since the usual location, system/media/bootanimation.zip is giving me an Error:
offending entries: system/media/bootanimation.zip
besides this, the build also fails.
Can anyone help me to understand what I am doing wrong ?
Error message
If it is still relevant, I may have an answer for you.
There's a mechanism that prevents you from doing something to the system partition from the product makefile in some cases.
The solution to your specific situation might be different, and there are also suggested solutions in the link below.
If you have something that is a part of the system partition, and is not a product specific thing, you can also add it to:
build/make/target/product/generic_system.mk
instead of the product specific makefile
Here is a link explaining this mechanism

How to transfer Files from OPC UA Client to Server

I want to Download and Upload, for example a .txt file, with the UA-Expert Client to/from a Server which i have set up on a Device.
Could someone provide me a Step by Step solution or an example on how to implement this?
I first followed the tutorials from the open62541 website.
I tried to follow and understand the OPC-UA-Specifications, particularly Part 5 Annex C.
Thank you in Advance.
open62541 doesn't support this out of the box meaning that there is no pre-made plugin which implements the required Objects for the various platforms.
That said it isn't to much work to do it yourself (especially if you don't need something generic/cross platform).
I've done such a one-off a few months ago. It was like 2 days of work. It was limited to downloading specific files from the server.
If my memory serves me well all you need to do is to enable the generation of the types specified by part5/annex c (there is a .txt or .csv in the sourcetree containing all the types that should be generated), after that you need to instantiate such an object (File for example) and place it somewhere in your server address space. What is left to do is to implement the various methods (open, read, ...) And to hook up your objects with callbacks to these.
This feature was added recently, but is not yet included into the official release.
Have a look at: https://github.com/opcua-tsn-team-kalycito/open62541/tree/fileType_object_implementation
(Make sure to use the commit 76eb14f6886911f954c40492cbe346c69b055ba5; the latest commit is not working)
An example implementation is:
UA_StatusCode result = UA_Server_addFile(server, FileTypeNodeId,
UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER),
UA_NODEID_NUMERIC(0, UA_NS0ID_ORGANIZES),
UA_QUALIFIEDNAME(1, "Sample File"),
oAttr, filePath, NULL, NULL
);

Is it possible to send HTTP GET Requests from a Simulink Block?

basically the title says it all. I'm working on a model that needs (there is no way around it) to load data from a website, parse it and pass it onto another block. I thought I could use an S-Function written in C++, which didn't properly work, then I tried to use webread()
which also didn't work in Simulink because I can't use extrinsic functions on the device this will run on.
I thought I could work around it by downloading the file externally and then reading it through fscanfbut it turned out that Matlab CODER doesn't support that as well.
After putting 2 1/2 days into this now, I'm asking myself whether it is even possible to do something like an HTTP Request through a Simulink block. That's why I went here to ask that question. Thanks for every answer!
I figured out a way to do it with a C++ S-Function by now.
I also created a GitHub Repo for it. If you're stuck with the same problem as I was, try to take a look at this. I'm pretty sure it will help you.

VxWorks PCI driver - compilation error

I am trying to write a PCI device driver in VXworks. Even though the source file is in place for the pciConfigLib, after compilation, it throws error stating " undefined function reference".
Any help is appreciated.
Thanks
VxNewbee
I am just going to throw this out there, but if you are in fact calling Pcifinddevice then that is wrong, you need pciFindDevice (case matters)
If that doesn't work, then from the vxworks shell can you show me the output of
lkup "pci"
Also be sure to read the device driver developers guide:
http://www.mecatronica.eesc.usp.br/wiki/upload/0/07/Vxworks_device_driver_developers_guide_6.0.pdf
It doesn't really have a good basic example of how to create a basic driver, but if you are using eclipse, then you should be able to create a new device driver project in there, it does give some good advice however, start from an existing template driver. Also there are other docs that you should be able to access from the wind river support site.
http://www.windriver.com/products/vxworks/

printk in driver

I am really new to linux module programming.
I need to some how be able to do some tweak to the ath9k driver in linux.
I finally got the compat wireless source code of ath9k to compile in ubuntu 11.04 and was trying to play around with the code.
I tried using printk to tried to get to see what happen.
First I put printk in the init.c file, the message I printed show up when I use dmesg in the terminal. However, when I tried to use the same printk in another file like rc.c it does not show up at all.
I am wondering why is that?
And is there some other way that I could some how log some information from the code similar to the fprintf. What I need is I need to extract somehow the packet header from the driver.
Thank you
Best Regards.
read about the proc fs, it's a great framework to extract data from device drivers.
once you have registered a device node as proc fs, you can read from it.
once the the read function is called, a callback function you defined is creating the output. this is an excellent way to retrieve data from device.
there are also two other methods, one is sysfs, you can google for it. and the second,
if the the device is a char device, you can implement an ioctrl function which returns the info you need.