* [ECOS] RedBoot/hal_diag.c confusion
@ 2001-01-11 11:23 Grant Edwards
2001-01-11 15:01 ` Grant Edwards
0 siblings, 1 reply; 2+ messages in thread
From: Grant Edwards @ 2001-01-11 11:23 UTC (permalink / raw)
To: ecos-discuss
I've added virtual vector support to my HAL, and it works when
building stand-alone eCos applications.
With CYGSEM_HAL_VIRTUAL_VECTOR_DIAG set, it uses the virtual
vector table. With it unset, it uses old-style diagnostic I/O
routines.
However, when I build RedBoot, it somehow seems to use both.
The output I get when I start RedBoot looks like (some white
space elided):
ARM RPSH HAL (no virtual vectors)
Memory Config:
[...]
ARM RPSH HAL (with virtual vectors)
Memory Config:
[...]
+
RReeddBBoooott((ttmm)) ddeebbuugg eennvviirroonnmmeenntt -- bbuuiilltt 1122::4444::1188,, JJaann 1111 22000011
PPllaattffoorrmm:: CCoommttrrooll RRPPSSHH22 ((AARRMM 77TTDDMMII))
CCooppyyrriigghhtt ((CC)) 22000000,, RReedd HHaatt,, IInncc..
RRAAMM:: 00xx0000000000000000--00xx0000008800000000
RReeddBBoooott>>
At that point, I hit <enter> and get the normal prompt and
everything seems OK:
RedBoot> help
help
Manage machine caches
cache [ON | OFF]
[...]
RedBoot>
my hal_diag.c file is structured like this:
#if defined(CYGPRI_HAL_IMPLEMENTS_IF_SERVICES)
[...]
void cyg_hal_plf_serial_putc(void *__ch_data, char c)
[...]
static void cyg_hal_plf_serial_init(void)
{
hal_virtual_comm_table_t* comm;
int cur = CYGACC_CALL_IF_SET_CONSOLE_COMM(CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT);
HAL_INTERRUPT_MASK(rpsh_ser_channels[0].isr_vector);
cyg_hal_plf_serial_init_channel(&rpsh_ser_channels[0]);
CYGACC_CALL_IF_SET_CONSOLE_COMM(0);
comm = CYGACC_CALL_IF_CONSOLE_PROCS();
CYGACC_COMM_IF_CH_DATA_SET(*comm, &rpsh_ser_channels[0]);
[...]
diag_printf("\nARM RPSH HAL (with virtual vectors)\n");
[...]
}
void cyg_hal_plf_comms_init(void)
{
[...]
cyg_hal_plf_serial_init();
}
#endif //CYGPRI_HAL_IMPLEMENTS_IF_SERVICES
#ifndef CYGSEM_HAL_VIRTUAL_VECTOR_DIAG
// old style I/O routines
void hald_diag_write_char(char c)
{
static int init;
if (!init)
{
[...]
diag_printf("\nARM RPSH HAL (no virtual vectors)\n");
init = 1;
}
}
#endif //CYGSEM_HAL_VIRTUAL_VECTOR_DIAG
I've checked the header files:
CYGPRI_HAL_IMPLEMENTS_IF_SERVICES is defined
CYGSEM_HAL_VIRTUAL_VECTOR_DIAG is not defined
Therefore, both sections of hal_diag.c are getting compiled.
Apparently Redboot is calling both hal_diag_write_char()
and the newer virtual vector table routines.
Since CYGSEM_HAL_VIRTUAL_VECTOR_DIAG is not defined, why is
Redboot using the virtual vector table routines?
If I set CYGSEM_HAL_VIRTUAL_VECTOR_DIAG to 1 in ecos.ecc, then
RedBoot crashes. I'm confused...
--
Grant Edwards
grante@visi.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [ECOS] RedBoot/hal_diag.c confusion
2001-01-11 11:23 [ECOS] RedBoot/hal_diag.c confusion Grant Edwards
@ 2001-01-11 15:01 ` Grant Edwards
0 siblings, 0 replies; 2+ messages in thread
From: Grant Edwards @ 2001-01-11 15:01 UTC (permalink / raw)
To: ecos-discuss
On Thu, Jan 11, 2001 at 01:27:21PM -0600, Grant Edwards wrote:
> ARM RPSH HAL (no virtual vectors)
> Memory Config:
> [...]
> ARM RPSH HAL (with virtual vectors)
> Memory Config:
> [...]
That was caused by not setting CYGSEM_HAL_VIRTUAL_VECTOR_DIAG.
Both hal_diag_write_char() and cyg_hal_plf_comms() end up being
called.
There was another bug that happend when it was set, but that's
fixed.
> RReeddBBoooott((ttmm)) ddeebbuugg eennvviirroonnmmeenntt -- bbuuiilltt 1122::4444::1188,, JJaann 1111 22000011
> PPllaattffoorrmm:: CCoommttrrooll RRPPSSHH22 ((AARRMM 77TTDDMMII))
> CCooppyyrriigghhtt ((CC)) 22000000,, RReedd HHaatt,, IInncc..
>
> RRAAMM:: 00xx0000000000000000--00xx0000008800000000
> RReeddBBoooott>>
That's what happens when you point both diag channels at the
same UART. ;)
Now all I have to do is write a flash driver, test the Ethernet
driver, and add virtual-vector drivers for a third diag channel,
and add a couple commands...
--
Grant Edwards
grante@visi.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-01-11 15:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-11 11:23 [ECOS] RedBoot/hal_diag.c confusion Grant Edwards
2001-01-11 15:01 ` Grant Edwards
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).