why UART is not working in STM32 nucleo 144 Board? - stm32

I am using Nucleo L552ZE-Q Board and Realterm terminal,but after debugging, terminal is blank.Here with I have attached the code.It shows no error and no warnings,Led is toggling.I am using LPUART1,Baudrate 115200 bits/s. Any help would be appreciated.Thank you
enter code here
#include "main.h"
/* Private variables ---------------------------------------------------------*/
UART_HandleTypeDef hlpuart1;
DMA_HandleTypeDef hdma_lpuart1_rx;
RTC_HandleTypeDef hrtc;
/* USER CODE BEGIN PV */
uint8_t myTXData[13]="Hello all \n";
uint8_t myRXData[11];
/* USER CODE END PV */
/* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);
static void MX_GPIO_Init(void);
static void MX_DMA_Init(void);
static void MX_RTC_Init(void);
static void MX_LPUART1_UART_Init(void);
int main(void)
{
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_DMA_Init();
MX_RTC_Init();
MX_LPUART1_UART_Init();
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
HAL_UART_Transmit(&hlpuart1,myTXData,13,10);
HAL_GPIO_TogglePin(LED_GREEN_GPIO_Port,LED_GREEN_Pin);
HAL_Delay(500);
}
/* USER CODE END 3 */
}
pin details

Related

STM32 Hal Driver crashes on init

I have STM32F030C8T.
Using CubeMX to generate basic init code including:
/* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);
void Error_Handler(void);
static void MX_GPIO_Init(void);
static void MX_TIM6_Init(void);
static void MX_USART1_UART_Init(void);
static void MX_ADC_Init(void);
static void MX_SPI2_Init(void);
static void MX_NVIC_Init(void);
/* USER CODE BEGIN PFP */
/* Private function prototypes -----------------------------------------------*/
/* USER CODE END PFP */
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration----------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Configure the system clock */
SystemClock_Config();
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_TIM6_Init();
MX_USART1_UART_Init();
MX_ADC_Init();
MX_SPI2_Init();
/* Initialize interrupts */
MX_NVIC_Init();
/* USER CODE BEGIN 2 */
ADC, TIM6, USART have basic IRQ handlers.
Builds ok, but when debug starts - it goes to the hard fault or indefinite region... Works fine only if TIM6_init and USART_init are commented.
What can be wrong? In which way i need to look?

How to update decorator on file save?

I have created a plugin with decorator which takes current file as input and show appropriate decorator.
This is working fine and decorator is shown properly when the eclipse loads for the first time.
However, when file changes, decorator is not updated.
How can I update decorator every time file is modified? i.e. How can I update decorator on file save event?
This is the sample code
public class Decorator implements ILightweightLabelDecorator {
private final ImageDescriptor OVERLAY1 = AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/1.png");
private final ImageDescriptor OVERLAY2 = AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/2.png");
/*
* (non-Javadoc)
*
* #see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
*/
#Override
public void addListener(ILabelProviderListener listener) {
// TODO Auto-generated method stub
// IResourceChangeEvent.POST_CHANGE
}
/*
* (non-Javadoc)
*
* #see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
*/
#Override
public void dispose() {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* #see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
*/
#Override
public boolean isLabelProperty(Object element, String property) {
// TODO Auto-generated method stub
return false;
}
/*
* (non-Javadoc)
*
* #see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
*/
#Override
public void removeListener(ILabelProviderListener listener) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* #see org.eclipse.jface.viewers.ILightweightLabelDecorator#decorate(java.lang.Object, org.eclipse.jface.viewers.IDecoration)
*/
#Override
public void decorate(Object element, IDecoration decoration) {
if (some_condition)
decoration.addOverlay(OVERLAY1);
else
decoration.addOverlay(OVERLAY2);
}
}
You can ask the IDecoratorManager to update decorations with a specific id using:
IDecoratorManager decoratorManager = PlatformUI.getWorkbench().getDecoratorManager();
decoratorManager.update("decorator id");
To do this on file save you will have to use an IResourceChangeListener to listen to workspace resource changes and react when you see your file being changed.
Set up a listener with:
ResourcesPlugin.getWorkspace().addResourceChangeListener(listener);
In the IResourceChangeListener you can do something like:
public void resourceChanged(IResourceChangeEvent event) {
IResourceDelta delta = event.getDelta();
IResourceDelta fileDelta = delta.findMember(IPath of file you are interested in);
if (fileDelta != null) {
// TODO handle the delta
}
}

Typo3 Fluid extbase- How to execute external controller?

I have 2 different extension. I want to execute second controller (external) inside my first controller
Two different extension 1. Course , 2. Search
class CourseController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
/**
* courseRepository
*
* #var \TYPO3\Courses\Domain\Repository\CourseRepository
* #inject
*/
protected $courseRepository = NULL;
/**
* action list
*
* #return void
*/
public function listAction() {
/** I want to access Search extension Controller (f.e searchRepository->listAction() )**/
}
}
class SearchRepository extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
/**
* searchRepository
*
* #var \TYPO3\Courses\Domain\Repository\SearchRepository
* #inject
*/
protected $searchRepository = NULL;
/**
* action list
*
* #return void
*/
public function listAction() {
$searches = $this->searchRepository->findAll();
$this->view->assign('searches', $searches);
}
}
tl;dr:
Within a Controller, you usually forward() or redirect() to delegate to a different ControllerAction, e.g. delegate to SearchController::listAction() of 'myExtensionKey':
$this->forward('list', 'Search', 'myExtensionKey');
or
$this->redirect('list', 'Search', 'myExtensionKey');
Long version:
Quote from the MVC documentation of Flow which is quite similar to Extbase MVC:
Often, controllers need to defer execution to other controllers or
actions. For that to happen, TYPO3 Flow supports both, internal and
external redirects:
in an internal redirect which is triggered by forward(), the URI does
not change.
in an external redirect, the browser receives a HTTP
Location header, redirecting him to the new controller. Thus, the URI
changes.
The APIs are:
public void forward(string $actionName, string $controllerName=NULL, string $extensionName=NULL, array $arguments=NULL)
protected void redirect(string $actionName, string $controllerName=NULL, string $extensionName=NULL, array $arguments=NULL, integer $pageUid=NULL, int $delay=0, int $statusCode=303)
The programming API details can be found in the Extbase API

phpdoc suggesting type for $this->someField

In Netbeans and phpStorm,
this works as expected:
public function someMethod() {
$objectA = uberEnterprisyFactory('someclassA');
/* #var $objectA TheClassA */
// $objectA-> (autocomplete for TheClassA is displayed, good)
This does not:
public function someMethod() {
$this->objectA = uberEnterprisyFactory('somemodelA');
/* #var $this->objectA TheClassA */
// $this->objectA-> (no autocomplete here, not good, $this->objectA is inferred to be null)
How can I sugest type of $this->someThing to Netbeans and/or phpStorm?
Use the following PHPDoc annotation:
class MyClass {
/**
* #var MyPropertyClass
*/
private $myProperty
}

Vala: D-BUS object implementing interface, error with properties

Is it possible to have a class annotated with [DBus (name = ...)] implement an interface?
Following the example at https://live.gnome.org/Vala/DBusServerSample, I am implementing a D-BUS client/server application.
One thing that I found peculiar about the example was that there was no separate interface definition. I would like to have the interface used by the client side in a separate file, and have the server class implement that interface. That way I can have the compiler tell me when I miss something.
This does not appear to work with properties though. The following definition is compatible with what I have:
/* interface.vala */
namespace org.test {
[DBus (name = "org.test.Items")]
public interface IItems : Object {
/**
* The object paths to the item instances.
*
* These objects are of type org.test.items.Item.
*/
public abstract ObjectPath[] items {
owned get;
}
/**
* The signal that is emitted when a new item is added.
*
* When this signal is emitted, the item will be available.
*
* #param id
* The object path to the item instance.
*/
public signal void item_added(ObjectPath id);
/**
* The signal that is emitted when an item is removed.
*
* When this signal is emitted, the item will be unavailable.
*
* #param id
* The object path to the item instance.
*/
public signal void item_removed(ObjectPath id);
/**
* Adds a new item.
*
* The URL will be parsed, and if it contains a valid item, it will be
* added.
*
* #param url
* The URL to the item. This should typically be the URL of the
* RSS feed.
* #return the ID of the item added, which can be used to query D-BUS
* for it
* #throws IOError if a D-BUS error occurs
*/
public abstract ObjectPath add_item(string url) throws IOError;
/**
* Removes an item.
*
* #param id
* The ID of the item to remove.
* #throws IOError if a D-BUS error occurs
*/
public abstract void remove_item(ObjectPath id) throws IOError;
}
}
/* server.vala */
using Gee;
namespace org.test {
[DBus (name = "org.test.Items")]
public class Items : DBUSObject, IItems {
private ArrayList<Item> _items;
[DBus (visible = false)]
protected override void dbus_register(DBusConnection conn,
ObjectPath path) throws IOError {
conn.register_object(path, this);
}
[DBus (visible = false)]
public Items() {
base("org.test.Items", "/org/test", "Items", true);
_items = new ArrayList<Item>();
}
[DBus (visible = false)]
~Items() {
unregister();
}
/**
* #see interface.vala::org.test.IItems.comics
*/
public ObjectPath[] items {
owned get {
ObjectPath[] result = {};
foreach (var item in _items) {
result += new ObjectPath(item.path);
}
return result;
}
}
/**
* #see interface.vala::org.test.IItems.add_comic
*/
public ObjectPath add_item(string url) throws IOError {
/* . . . */
}
/**
* #see interface.vala::org.test.IItems.remove_item
*/
public void remove_item(ObjectPath id) throws IOError {
/* . . . */
}
}
}
When I compile it, I get no error from valac, but when the generated C code is compiled, the linker complains: undefined reference to 'org_test_items_get_items'.
This function is referenced by _dbus_org_test_items_get_items, but it does not exist
It's obviously a bug. The right place to report bugs is http://bugzilla.gnome.org .