Serial Console Driver as a Loadable Module - drivers

Can a linux 2.6 serial console driver that registers itself using the console_initcall() macro be developed as a loadable module or must it be compiled in-kernel?

As described in the kernel documentation there needs to be a system console driver which is called during the initialization phase.
So if you want default system console support for the serial drivers, you need to have them in-kernel. See drivers/tty/serial/Kconfig for the existing drivers.
This discussion might be also interesting for you.

serial console module can be initialize also inside the UART driver also if UART supports serial console then UART driver structure's cons field would be pointing to serial console.

Related

STM32 libraries for eclipse

Can you use the CMSIS, HAL, TM libraries for STM32F407 discovery board with eclipse, without STM32Cube? According to this link http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/ you can do it with eclipse & STM32Cube. But I wonder if you can do just same thing without the STM32Cube. Since I'm using OS X, it is impossible to install the STM32Cube, but in order to use the GPIO library I need to use CMSIS, HAL, TM libraries.
You might be able to used the older "Standard Peripheral Driver" model - which was a just a distributed set of driver files specific to the chip. These libraries are no longer supported and are replaced by STM32Cube which generates equivalent code - but with better support for hardware abstraction however they are still very useable.
Search "STM32F4xx_StdPeriph_Driver" to locate the libraries (which include the standard peripheral drivers and CMSIS).
You can download the libraries as a separate zip file
http://www.st.com/web/en/catalog/tools/PF259243
just unpack it and import whatever you need from it into your project. You can take an example project which is closest to your needs, and start developing your application from that. That's what I did in Linux.
There is the STM32CubeMX, which is the installable program you're referring to, and there are STM32CubeF4, STM32CubeL0, etc, which are the firmware package for the different controller families.
CubeMX now officially supports Mac and Linux. However here is an old post how to run it manually http://www.carminenoviello.com/2015/09/09/running-stm32cubemx-macos-finally/.
Regarding the HAL and SPL I'll add that there are really nice libraries in libopencm3 which are developed by community and are not so "buggy" as HAL or SPL.
I found an interesting instruction. You can install the STM32CubeMX on OS X. http://www.stm32duino.com/viewtopic.php?t=267
There is an Eclipse based IDE by OpenSTM32 community called SW4STM32. Available at OpenSTM32 community's site. System Workbench for STM32 installer has been released on the following platforms:
Microsoft Windows Vista and newer (32 bits or 64 bits)
Linux (32 bits or 64 bits)
Mac OSX 10.10 Yosemite and newer + Xcode 7
Java SE JRE 7 or newer
When creating a project you can choose which library you want want to use, SPL, HAL or baremetal.
STM32CubeMX is a initialization code generator. It definitely eases development, but you can write you code completely from the beginning.
STM32CubeMX uses HAL as its Library. You can download the HAL and Include the files that you need and write down the code from scratch. You just need to be aware of the APIs, which are documented in UM1725 Application Note.
But, now STM32CubeMX is also available for Linux and Mac.

Updating Linux Device Driver

I'm a LDD newbie and I've been assigned a task of upgrading a driver which worked on a 2.6.35 kernel to work on a current kernel, 3.6.10.
In order to get the driver to compile, I had to change from ioctl to unlocked_ioctl as described here.
Yet, the driver fails to execute several of its operations properly.
The driver is supposed to use DMA via the PCI bus to write to a buffer on the host. I suspect the interrupts the device is issuing are not going through.
Are there any obvious changes that I need to make to get this driver to work?
I assume there is change only in the kernel version and not there in your hardware. Do you get any error while compiling?

clGetPlatformIDs error -1001 when called in PostgreSQL UDF

I'm trying to write an OpenCL function that would be executed inside PostgreSQL. To do this i create DLL from my OpenCL code and link it to postgres using User-Defined Function mechanism. Everything goes well until clGetPlatformIDs is called. Function returns error -1001, which I read that indicates problem with finding OpenCL drivers.
I've tried to compile the same code(i had to remove some postgres magic) to exe and runed it with success - all platforms were found correctly, so I assume that i have correctly set up SDK and drivers.
I am runing PostgreSQL 9.1 on windows 7 x64. I am also using Nvidia CUDA SDK 4.2 with Visual Studio 2010 and running my code on GeForce GTS 450.
It's MSFT's problem with Windows, Services, GPUs, Security and device drivers.
You can't run PostgreSQL as a service on Windows AND see any GPUs. You are hitting Session O Isolation which does NOT allow any 'graphics' device access from a Windows Service. You can start PostgreSQL as a process (not a service) or put the server on Linux.
See http://www.scribd.com/doc/58343489/Windows-Session-0-Isolation-Impact-on-GPU-as-Service
Also there are other important reasons to run on Linux, as Windows will want to reboot your GPU if the screen is not accessed before the timeout period. See
http://msdn.microsoft.com/en-us/library/windows/hardware/ff570088%28v=vs.85%29.aspx
NVida have a non-graphics GPU device driver for specific Tesla cards on Windows. These cards don't have any video output. So they aren't considered to be graphics device drivers.
Maybe the libraries try to locate the SDK using some environment-variables and the environment is not inherited inside the PostegreSQL context.
So try to dump the environment from your two codes and check if any OpenCL/Cuda variables is available in your standalone program and missing in your PostegreSQL UDF.

How do I remote debug over Serial Port or USB with Eclipse?

I'm working on a device that has an unstable wireless connection and therefore requires a serial cable to debug programs that run on it while the Firmware team works on fixing the wireless connections. This happens often as new devices tend to be unstable at first. The problem is I can't seem to find out how to remote debug in Eclipse CDT when using a serial port. I've been doing some searching online and have found lots of info about remote debugging via SSH, FTP and Telnet. Although, I can't find anything about debugging through the serial port. I was able to find info on and use a serial terminal in Eclipse but as far as I can tell this doesn't help me debug a program remotely with the serial connection. I also know that it's possible due to this Eclipse bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=257171
Unfortunately that doesn't tell me how to use this new support :(
I also know GDB allows debugging via serial cable, so surely there is a way to do it with the Eclipse debugger. I was also wondering if there is a way to get the "Remote System Explorer", an Eclipse plugin, to use a serial port as well? As far as I can tell it doesn't seem to support serial connections. Is there another plugin like it that does support serial connections? Any and all help is greatly appreciated.
From the comments by the patch it looks like official support is in Eclipse 3.6 (Helios) M7
The supported CDT approach seems to be to use the GDB serial protocol.
http://www.embecosm.com/appnotes/ean4/embecosm-howto-rsp-server-ean4-issue-2.html

omap3 gpmc config in linux

Is it possible to change configuration of a OMAP3 gpmc after boot-up on linux? I am writing a driver for a device that use the OMAP3 gpmc bus. We would prefer to be able to load the driver only when needed. Would linux allow it, since the GPMC control also program memory?
(If you haven't done it already, I suggest you join TI e2e community: there are many ongoing discussions about TI OMAP architecture and TI engineers overview the forums to provide answers).
You could specify a device driver as built-in or module when you configure the kernel. You can load that module later on with the insmod command. That option depends on your target architecture, of course.