[Qbs] [baremetal] I looking proffesionals faced with Cypress FX2 && IAR

Denis Shienkov denis.shienkov at gmail.com
Sat Oct 19 09:13:45 CEST 2019


Hi Richard,

 > - interrupt tables not correctly initialized
 > - missing volatile qualifier in variables shared between task and 
interrupt
 >  context.

I'm don't use an interrupt handlers. I do polling for the interrupt 
flags in a main loop.

 > - use a GPIO and a logic analyzer to output serialized data at certain
checkmarks to see whether the program works correctly.

It did not helps, because a problem is somewhere  deeped. E.g. in this code:

static BOOL ep0_std_descriptor_proc(void)
{
     BYTE XDATA *pdesc =
             (BYTE XDATA *)hid_ep0_std_desc_get();
     if (pdesc) {
         SUDPTRH = usb_word_msb_get(pdesc);
         SUDPTRL = usb_word_lsb_get(pdesc);
         return TRUE;
     }

     return FALSE;
}

something wrong with SUDPTRH && SUDPTRL features. It is a HW features of 
this chip which transfer the content of a "standard" descriptors to the 
HOST automatically. I.e. enough to set an address of a descriptor 
structure to the  SUDPTRH and SUDPTRL registers.

 > If you want to show-case multi-toolchain development with Qbs, why 8051?

Why not? Look to Aliexpress how much this chip costs (also many Logic 
Analyzers based on this chip). :) This is a very good chip && architecture.

 > Why should anybody invest time in using Qbs on 8051?

Are you know that a many modern chips based on 8051 architecture? Look 
on TI, Cypress and etc. This architecture is more simple than ARM, the 
ARM it not a panacea to all.

PS: Besides, that my project on GitHub contains also and two branches 
for the ARM archs (stm32f4 && stm32f103). But there are a problem is 
that we can't use a HAL to provide it as QBS example (due to licensing 
and etc). So, in that case, need to refactor that projects and get rid 
of HAL before submitting it to QBS example.

Summary: I have created this topic in hope that someone used IAR for 
this chip... So, maybe I can get a minimal valid example... :) If NOT - 
it is not a problem.


BR,

Denis


19.10.2019 0:02, Richard Weickelt пишет:
> Hi,
>
>> Currently it does work with Keil C51 compiler && SDCC compiler. But, it does> not work with an IAR 8051 compiler.
> I guess you do not have JTAG access to this device and can step-debug. But
> it looks like you have GPIOs that you could access with a logic analyzer.
>
>> I don't know why, but the USB enumeration fails, the OS can't fetch the USB
>> descriptors from the FW. e.g. at attempt to fetch the USB "Device
>> Descriptor", the OS receives a zero data.
> I haven't reviewed Your code, but here are some ideas:
> - interrupt tables not correctly initialized
> - missing volatile qualifier in variables shared between task and interrupt
> context. This is a common mistake, especially when one side uses this
> variable in a loop (task waiting for a flag) and never observes a change
> because the variable value is kept in a register.
>
>> Maybe, someone can help me? Because I have not ideas why it does not work
>> with IAR.
> Possible strategies when you cannot debug with JTAG:
> - use a GPIO and a logic analyzer to output serialized data at certain
> checkmarks to see whether the program works correctly.
> - decompose your application, make sure that the peripherals are working one
> after another
>
>> PS: A google has not any mention or example at using this chip && IAR compiler.
> And that makes me wonder if you are the only person on the planet trying to
> do this. This looks like a hobby project. Is IAR even used among hobbyists?
>
> If you want to show-case multi-toolchain development with Qbs, why 8051? I
> doubt that any company uses 8051 for new projects. At least, companies would
> build upon a large legacy codebase and infrastructure (we have done this for
> 30 years...) . Why should anybody invest time in using Qbs on 8051?
>
> However, your project looks exotic enough to be fun :)
>
> Richard
> _______________________________________________
> Qbs mailing list
> Qbs at qt-project.org
> https://lists.qt-project.org/listinfo/qbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20191019/1a84a89b/attachment-0001.html>


More information about the Qbs mailing list